There are very few positive surprises in drug-company investing. Sure, companies like Dendreon (Nasdaq: DNDN) can get a positive surprise from a review panel and then a negative surprise from the FDA, but I'm talking about surprises whose timing investors couldn't see coming. Like when you walk into a dark room and everyone yells, "Happy Birthday!" -- and your birthday is five months away.

Repligen's (Nasdaq: RGEN) investors got that kind of surprise yesterday when the company announced it had settled a patent infringement suit with Bristol-Myers Squibb (NYSE: BMY) over Bristol's rheumatoid arthritis drug, Orencia. It had looked like the dispute would go to trial; jury selection was scheduled to begin this month. Investors didn't seem to mind the surprise, sending the stock up 14% yesterday.

Repligen will get $5 million up front, plus retroactive tiered royalties that reach as high as 4% on sales of Orencia above $1 billion, annually for six years.

The company is expecting to receive between $7 million and $8 million in royalties in the 15 months before its fiscal year ends in March of next year. In total, Repligen is pegging the royalty payments at around $117 million over the next six years if Orencia sales grow as Repligen estimates they will. It'll have to pay the University of Michigan 15% of its payments -- after subtracting legal costs -- because Repligen licensed the patent from the university.

Repligen has done well at enforcing patents it has licensed from universities. Last year it got ImClone Systems (Nasdaq: IMCL) to pay $65 million because ImClone's cancer treatment, Erbitux, infringed on a patent, and that netted Repligen about $40 million after sharing with The Massachusetts Institute of Technology. Sales of Erbitux will likely increase as it expands into treating patients with non-small cell lung cancer, but that settlement unfortunately didn't come with royalties.

Repligen might have been able to get a higher royalty rate if it had gone to court, but winning isn't guaranteed and appeals take a long time. The surprise settlement provides guaranteed cash now -- something every drug developer needs.

Motley Fool Rule Breakers is on the hunt for hot drug stocks and other cutting-edge picks. Click here to see all of our latest discoveries with a free, 30-day trial subscription.

Fool contributor Brian Orelli, Ph.D., doesn't own shares of any company mentioned in this article. The Fool has a disclosure policy.