What a long, strange trip it's been.

For more than four months, COX-2 inhibitors like Vioxx, Celebrex, and Bextra have created monumental headaches for their makers, investors, patients, doctors, and regulators. As concerns over elevated risks of heart attack and stroke mounted, Merck (NYSE:MRK) withdrew Vioxx, and Pfizer (NYSE:PFE) faced increasing pressure to do the same with Celebrex and Bextra.

Pummeled by the reality of lost sales and the fears of potential lawsuits, Merck shareholders have suffered in the wake of the company's voluntary withdrawal of Vioxx. Though Pfizer didn't suffer quite as much, the stock still came under pressure as investors feared the possibility of withdrawal and future lawsuits.

Now it looks as though COX-2 inhibitors will stay on the market after all. On Friday, an FDA advisory panel summoned to evaluate the safety of Vioxx, Celebrex, and Bextra (and COX-2 inhibitors in general) gave its blessing to permitting sales of all three drugs. Although the FDA is not obligated to follow the advice of its specialty panels, it generally does.

It should be noted that the FDA panel was not exactly overwhelmingly supportive of COX-2 inhibitors. Rather, the panelists acknowledged that other painkillers have high risks as well and that the risk-benefit analysis of using COX-2 drugs was best left between physicians and their patients.

That said, the panel voted 31-1 to allow Celebrex to stay on the market, 17-13 in favor of Bextra, and 17-15 in favor of Vioxx. It should be noted as well that Vioxx was singled out by many panelists as clearly the most potentially dangerous of the three, given the data that they have seen thus far.

What now?
Unfortunately, the future is still murky. The FDA will take the panel's recommendations under advisement and formulate its own guidelines. While there is no telling how long that might take, the high-profile nature of the issue (and the large number of patients affected) would suggest sooner rather than later. Whenever the FDA acts, a few things seem pretty likely.

For starters, all of the drugs involved will likely have to carry what is called a "black box" warning label. This is a special type of warning label that alerts doctors to medications with the potential for very severe side-effects. What's more, the presence of black-box warnings will mean that the FDA will strongly discourage the companies from direct-to-consumer advertising.

Black-box warnings do not prevent patients from getting the medication they need, but they do tend to make the physician think twice about prescribing them. Such warnings also generally obligate physicians to have a bit more discussion with their patients regarding the risks involved -- which can scare off some patients. Thus, it is not at all unreasonable to think that the presence of the heightened warnings themselves will hurt future sales.

For Pfizer, it is unlikely that Celebrex will continue to sell at a $3-billion-plus annual rate. Not only are patients and doctors now more cautious and aware of the risks, but also Pfizer will likely not be able to advertise the drug directly to patients.

During the time when rumors and concerns were swirling around Celebrex, prescription share was cut, basically in half. Although Pfizer should regain some of that lost business, investors should not expect a full recovery. That said, even "just" $1 billion or $2 billion in sales will make a meaningful impact on the business.

The impact on Merck, which is a Motley Fool Income Investor recommendation, is even less clear. Given that the Vioxx withdrawal was voluntary, the path for Merck to resume sales is a little more uncharted. The company will certainly have to consult with the FDA over new warning labels for the drug and that process will take time.

Assuming that Vioxx is actually returned to the market, Merck could still see upwards of $1 billion in sales. Although potentially dangerous, Vioxx is effective, and for some patients is the only real option for meaningful pain relief.

It's impossible to say what impact this panel's decision will have on ongoing Vioxx litigation. Class action lawyers aren't going to let a major payday slip away without a fight, so there's every reason to believe they will pursue these suits. What's more, anything can happen in a trial. The fact that Merck has the FDA's blessing to sell Vioxx isn't going to shield Merck from jury awards if the plaintiffs can convince jurors that Merck was negligent in the marketing of Vioxx and/or negligent in presenting the risks of the drug and therefore partly (or wholly) responsible for patient deaths.

The future
It is also unclear just what impact this panel meeting will have on future COX-2 drugs. Among others, Merck is working toward approval of Arcoxia and Novartis (NYSE:NVS) is developing Prexige. At this point, it would not be unreasonable to assume that the FDA might ask for more rigorous safety testing and/or insist on strongly worded cautionary labels and limited direct advertising.

It is also not unreasonable to think that this entire episode will lead the FDA to encourage (or perhaps even mandate) even more rigorous safety testing during a drug's development phase. For companies like eResearch Technology (NASDAQ:ERES) and others that provide and facilitate advanced cardiological testing, such a move could be a boon. Of course, greater FDA mandates for safety studies would add time and cost to the drug development process -- something that would generally be bad for the biotech industry as a whole.

It's never over until it's over -- a notion well demonstrated by the concern and chaos surrounding COX-2 drugs. As investors and patients have learned via the likes of Johnson &Johnson (NYSE:JNJ) and Wyeth (NYSE:WYE), FDA approval doesn't necessarily mean that a drug is totally safe, or that the company is safe from future lawsuits.

Investors have also been given a reminder that decisions on pharmaceuticals aren't always black and white. While some drugs are clearly unsafe and other drugs are almost always safe when used properly, there is a hazy grey area for many drugs. In that grey area, there is a trade-off between the demonstrated benefits of the medication and the potential for possibly serious side effects and consequences. Unfortunately, no amount of testing or regulatory review will ever remove all of the uncertainty, so investors (not to mention patients) will have to learn to accept a certain level of risk with prescription drugs.

Looking ahead, investors should give a good, long look to the drug sector. Many stocks are trading at valuations that haven't been seen in 10 or more years. Although it's true that many companies have been hurt by generic competition, this seems to be on the decline. What's more, many companies have drugs with blockbuster potential approaching the market. So, for those Fools who can accept a little risk, a careful study of the pharmaceutical industry should yield some very appealing investment opportunities.

Mathew Emmert selected Merck for Motley Fool Income Investor subscribers back in February of last year. Want to know why? Take a free trial today to learn more.

Fool contributor Stephen Simpson, CFA, owns shares of Johnson & Johnson. The Fool has a disclosure policy.