For most of 2005, it seemed like pharmaceutical company Forest Labs (NYSE:FRX) couldn't buy a break and generics company Teva Pharmaceuticals (NASDAQ:TEVA) couldn't do much wrong. For this year, though, it seems like things are finally going Forest's way, while Teva is finding itself in a run of bad luck.

Last night a federal court ruled in favor of Forest Labs and determined that the company's patent for Lexapro was valid and enforceable, and that Teva's attempt to market a generic version of escitalopram (the active ingredient for this anti-depressant) constituted infringement. That's a big deal for Forest -- Lexapro was over 60% of the company's revenue last quarter and there is nothing in the way of new drugs that could immediately replace the revenue that Forest would have lost if Teva had been allowed to market its generic product.

For Teva, this is a setback, but one that largely goes with the territory. When you make a big chunk of your living through legal attempts to overturn and invalidate patents, you're going to lose cases. At this point, Teva has a couple of options. They could launch the generic drug "at risk" in the hopes of winning on appeal, but they'd be liable for sizable damages if they lose that appeal. They could also simply appeal the decision and hope to win, just abandon the effort and wait for patent expiry in 2012, or try to seek out a negotiated settlement with Forest (though why Forest would agree at this point is a valid question).

Things have finally started looking up for Forest. True, they may face an appeal from Teva and they recently filed suit against CaracoPharmaceutical (AMEX:CPD) for another infringement on Lexapro. But at least the company's pipeline is fuller than it was a year ago -- including a drug for COPD, an antibiotic, and a licensing agreement with Mylan Labs (NYSE:MYL) for the hypertension and heart failure drug nebivolol.

Unfortunately, the easy money has long since been made in Forest and today's announcement will almost certainly mean another big jump in the stock price. Accordingly, it might be more Foolish to take a look at the loser in this case. Teva has some challenges these days (including aggressive pricing from Merck (NYSE:MRK) on a once-promising generic), but it could make for a fairly compelling long-term story.

For more Foolish thoughts from the pharma files:

Merck is an Income Investor recommendation.

Fool contributor Stephen Simpson has no financial interest in any stocks mentioned (that means he's neither long nor short the shares).