The victor is up 12% today, while the vanquished is down 40%... and that neatly sums up the incredible risks associated with drug makers and patent processes.

A federal judge has ruled that Andrx's(Nasdaq: ADRX) generic version of the heartburn drug Prilosec infringes on valid patents held by the drug's developer, AstraZeneca(NYSE: AZN). Astra's original Prilosec protection expired a year ago, but it asked for an extension because of new patents for a special formulation. In a surprise decision, the judge upheld Astra's claim and also ruled that two other generic makers -- Dr. Reddy's Laboratories(NYSE: RDY) and Genpharm -- infringed on the patents, while Germany's Schwarz Pharma's version of Prilosec did not.

The Andrx situation is a good illustration of the uphill battles generic producers must fight. The first company to receive FDA approval to make a generic drug has 180 days of marketing exclusivity. Considering Prilosec generated $3.7 billion in U.S. sales last year, this would have been an extremely lucrative period for Andrx. Ready to make hay while the sun was shining, the company had already built a $100 million manufacturing plant and purchased $65 million in inventory -- much if it now worthless. This is a big deal for a company that made only $73 million in 2001.

Chairman Elliot Hahn says he's "exceedingly disappointed by the court's decision" and may appeal the ruling. There is also the possibility the company will sell its 180-day exclusivity rights to another drug maker.

Andrx rang in the New Year with high expectations and a $70 stock price. Now trading at $12, its investors know firsthand the cruel twists and turns of the patent process.