Just two months ago, I wrote about the turnaround taking place at BioMarin Pharmaceutical (NASDAQ:BMRN). Over the past few quarters, the company reeled from its lousy acquisition of Orapred from Medicis Pharmaceutical (NYSE:MRX) and has been without a permanent CEO. BioMarin's stock was sent into a lengthy free fall that seemingly had no bottom.

Despite all its very real problems, I saw a lot of value in BioMarin's assets. I was pretty sure that the troubles were temporary and that with the right leadership in place, the company would blossom.

In those two months, the pieces have quickly fallen into place for BioMarin. After nine months without a permanent leader (a completely unacceptable situation, in my book) the company brought in a new CEO, Jean-Jacques Bienaime, a seasoned executive who, in his prior posts throughout the pharmaceutical industry, including stints at Genentech (NYSE:DNA) and Sanofi-Aventis (NYSE:SNY), established a track record of creating value for shareholders. He is exactly the type of leader that BioMarin needs to complete its turnaround.

There has also been some exciting news on the drug-development front. Yesterday, BioMarin announced that it has partnered with Swiss drugmaker Serono (NYSE:SRA) to develop Phenoptin and Phenylase. Under the terms of this deal, Serono will market the drugs in countries outside the United States and Japan.

Monetizing these assets is certainly a welcome development. BioMarin will receive a much-needed slug of $25 million in up-front cash, along with another $45 million for the filing and approval of Phenoptin in Europe for treating phenylketonuria (PKU). Since Phenoptin is currently in phase 3, with results expected late this year, the drug should be filed in the EU some time in the first half of next year.

Another important component of the deal is that half of the R&D costs for late-stage trials will be shifted to Serono. Cutting these expenses will help BioMarin control its cash burn -- a necessity, considering that the balance sheet is quite ugly and the company is not yet profitable.

All of these factors have resulted in a soaring stock price; BioMarin stock has shot up 30% in the past two months and is near its 52-week high.

Future prospects
BioMarin has certainly made a lot of progress this year, but it is not yet out of the woods. It is not profitable and has a shaky balance sheet, a dangerous combination that is often resolved by issuing equity and diluting the stakes of existing shareholders. Hopefully that doesn't happen here, but it may be unavoidable at some point, depending on how a few important events play out.

One such critical event will be decided by the end of this month, when the Food and Drug Administration decides whether BioMarin's drug Naglazyme (formerly rhASB) will be approved. Because of the company's weak financial situation, it really needs this drug to hit the market and start generating revenue.

Naglazyme is an enzyme-replacement therapy for a rare genetic disease called MPS VI. The drug is very similar to another of BioMarin's drugs, Aldurazyme, which Genzyme (NASDAQ:GENZ) currently markets. Given the seriousness of this disease, the lack of treatment options, and the prior approvals of several other enzyme-replacement therapies, I expect Naglazyme to get the nod from the FDA.

If approved, Naglazyme will be the only product available in a worldwide market worth several hundred million dollars. The company should be able to capture significant market share, making Naglazyme an important revenue generator for a company needing to strengthen its financials. Needless to say, the drug's approval is critical for BioMarin.

Investing in distressed companies like BioMarin is not easy. But because all of a company's warts are magnified and its positive attributes tend to get ignored, these kinds of situations can make great investment opportunities. The company's stock price tends to get crushed while it takes time to work through its problems. As long as the company's problems are temporary, the value of its assets should eventually be realized.

That is what is happening right now at BioMarin. The company is moving past the disastrous Orapred acquisition with two clear value drivers, Naglazyme and Phenoptin, coming into focus. As long as those drugs stay on track, BioMarin will complete its turnaround. Shareholders who saw the value of these products while the rest of the market was bailing out will be rewarded.

If you're interested in other biotech stock ideas, try a free 30-day trial to our Motley Fool Rule Breakers newsletter by clicking here. And for additional articles on the biotech industry, check out:

Motley Fool Rule Breakers biotech analyst Charly Travers owns shares in BioMarin Pharmaceutical. The Motley Fool has a disclosure policy.