Nothing is scarier for a pharmaceutical company than having a generic version of its top drug on the market much sooner than expected. Sanofi-Aventis (NYSE:SNY) and Bristol-Myers Squibb (NYSE:BMY) can breathe easier today after a U.S. court ruled that the patents on their blood thinner drug, Plavix, were valid.

Last year, sales of Plavix accounted for nearly $3 billion of Sanofi's sales and $3.3 billion of Bristol-Myers'. The Plavix saga began in early 2006 when the companies made a deal with generic drugmaker Apotex to prevent a costly and risky legal challenge over the drug's patents.

In exchange for letting Apotex launch a generic version of Plavix a few months sooner than the drug's key patents expiration in 2011, the companies dropped their litigation over the validity of the patents.

The U.S. regulatory authorities didn't take too kindly to such an anticompetitive deal and threw the agreement out. This led Apotex to launch a generic version of Plavix "at-risk" before the Plavix patents had either been ruled invalid or upheld in the U.S. courts.

This at-risk launch kneecapped Sanofi's and Bristol-Myers' top and bottom lines, but it put Apotex on the hook for billions of dollars in damages if the Plavix patents ended up being upheld in court. After the news today on the validity of the key Plavix patent, Apotex is at risk of having to pay such damages.

The elimination of the threat of more generic Plavix entering the U.S. market removes one of the major overhangs on Sanofi's and Bristol-Myers' top-line growth prospects. Despite being sold for only a month, the companies estimate that sales of Apotex's generic version of the drug cost them $1.2 billion to $1.4 billion last year and at least $300 million in the first quarter of 2007. The effect on generic Plavix from Apotex's brief entrance onto the market is expected to be felt through at least the end of the second quarter.

Sanofi's record in the U.S. courts is now tied at 1-1 this year after losing a case that could allow a generic version of its second top-selling drug, Lovenox, onto the market. An appeal of that ruling is still in the works. Since no generic drugmaker has received FDA regulatory approval for a generic version of Lovenox yet, Sanofi's sales of the drug are safe for now. I'm not one to bet on risky court battles, but investors who put their money behind Sanofi and Bristol-Myers in the Plavix matters have received a major victory today.

Looking for more Foolish drug stock coverage? Check out the Fool's market-beating Rule Breakers newsletter. You can see all our recommendations, as well as get access to our message boards and exclusive content, with a 30-day free trial.

Fool contributor Brian Lawler does not own shares of any company mentioned in this article. The Fool has a disclosure policy.