The Food and Drug Administration is like a box of chocolates; you never know what you're going to get. When GlaxoSmithKline (NYSE:GSK) and XenoPort (NASDAQ:XNPT) opened their mail from the agency yesterday, they found a complete response letter -- the FDA's euphemism for "rejection." The agency is worried about tests that showed their restless leg syndrome treatment Horizant caused pancreatic cancer in rats.

The rejection was a huge shock to the company and investors alike. XenoPort's stock was riding high going into the expected announcement, but got cut by two-thirds today after the rejection.

Investors had little reason to expect a rejection. In November, the companies said that the FDA was extending Horizant's review so the agency could go over the recently-requested Risk Evaluation and Mitigation Strategy (REMS), which is used to inform doctors about the correct use of a drug. If the drug wasn't going to be approved, why review the REMS? But then again, this is a government agency we're talking about; efficiency isn't always their strong suit.

Investors also had such high hopes for Horizant because the drug is an extended-release version of Pfizer's (NYSE:PFE) Neurontin, which was approved in late 1993 and has already gone generic. The cancer findings were known when Neurontin was approved for refractory epilepsy. However, the agency determined that the risks were acceptable for epilepsy, but not for the less-severe restless leg syndrome. The companies are also developing the drug as a treatment for nerve pain, which may be just as likely to fall into the "less-severe" category.

Figuring out what side effects the FDA will find acceptable for which indications is a tough job. Clearly, cancer drugs can slide by with fairly severe side effects, while the FDA will often heavily scrutinize the side-effect profile of weight-loss drugs like Abbott Labs' (NYSE:ABT) Meridia, or the ones up for approval from Arena Pharmaceuticals (NASDAQ:ARNA) and VIVUS (NASDAQ:VVUS).

But there's a grey area in the middle where it's difficult to judge. For instance, Novo Nordisk's (NYSE:NVO) diabetes drug Victoza gained approval, even though it had a cancer signal in lab animals. That decision probably could have gone the other way.

Since the FDA doesn't give many clues about which way it will decide on marketing applications, the only things investors can do are not put all their eggs in one basket and enjoy the ride up when the FDA actually does approve a drug.