If imitation is the sincerest form of flattery, then Endo Pharmaceuticals (Nasdaq: ENDP) should feel complimented by Alpharma (NYSE: ALO). On Wednesday, Alpharma announced that it was selling its active pharmaceutical ingredient business to help finance its branded pharmaceuticals and animal drugs businesses.

Active pharmaceutical ingredients (API) are the substances that cause drugs to do what they do. Like other drugmakers such as Teva Pharmaceuticals (Nasdaq: TEVA) and India-based Dr. Reddy's (NYSE: RDY), Alpharma has supplied these substances for many years.

Of Alpharma's three divisions, though, its API segment is the least sexy to pharma investors. It's a tough business, and macro events like currency movements and increased commodity prices can play havoc with its production costs and profits. In the first nine months of 2007, Alpharma brought in $139 million in sales through its API business, compared to $523 million in sales overall. API revenue growth is only projected in the 8% to 10% range for 2007, and operating margins for the business are relatively low, with 2007 third-quarter API operating margins of only 17.4%.

In 2007, Alpharma borrowed a page out of Endo's, Cephalon's (Nasdaq: CEPH), and King Pharmaceuticals' (NYSE: KG) playbooks and tried to transform itself into more of a specialty pharma, focused on pain drugs. It acquired two new pain drugs in the second half of the year, and it just launched one of them, a nonsteroidal anti-inflammatory pain patch dubbed Flector, last month.

Alpharma already markets the morphine pain drug Kadian, and it plans on filing for approval of an abuse-deterrent version of the compound in the first half of this year. The sale of its API division will give Alpharma a $395 million cash infusion, and it might use the cash on "targeted strategic growth opportunities in both its Pharmaceuticals and Animal Health businesses."

Alpharma looks like it's going all in on its pain drugs business, and for good reason; there are billions of dollars up for grabs in the opioid and other pain-drug markets. I wouldn't be surprised to see another pain-drug acquisition in Alpharma's future, because relatively minor improvements in currently marketed compounds can turn a long-genericized pain compound into the next blockbuster drug.

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 an A+ disclosure policy.