Image source: Getty Images.

After crushing the broader markets for five consecutive years, healthcare stocks have cooled off this year, presumably due to the uncertainty created by the U.S. presidential election. Even so, many healthcare companies continue to post outstanding quarterly numbers, driven by an aging population, Obamacare, and an unprecedented innovation boom in biopharmaceuticals. 

Specialty pharma stocks Endo International plc (ENDP), Horizon Pharma plc (HZNP), and Valeant Pharmaceuticals (BHC -1.69%) have had a particularly brutal 2016 due mainly to their relatively high debt levels and a Democrat-driven investigation into their core business model. 

ENDP Chart

ENDP data by YCharts.

With each of these companies now trading at highly compressed forward price-to-earnings ratios and well below their 52-week highs, it's fair to say these beaten-down healthcare stocks are "cheap." But are they a buy? Let's dig deeper to find out. 

The Street didn't take kindly to Endo's first-quarter surprise

Endo's stock has been in a tailspin ever since management slashed the company's full-year annual guidance for both total revenue (reduced by 11% from its former high-end estimate), and adjusted earnings per share (cut by 23%) during its first-quarter earnings release on May 5.

While this hefty revision reportedly stemmed from widespread price-erosion across the generic-drug market -- a business that makes up over half of Endo's revenue at present -- the performance of Endo's pain management franchise (composed of Lidoderm, Opana ER, Percocet, and Voltaren Gel) during the first quarter certainly didn't help matters. This key branded-drug franchise, for instance, saw its sales slip by 13% year over year as a result of increasing generic competition.

Given the lingering pricing concerns in the generic-drug space, Endo's falling share of the $40 billion pain management market, and the company's total debt that exceeds $8.5 billion, there are ample reasons to steer clear of this stock right now. On the flip side, the worst may be over, and the company's rock-bottom forward price-to-earnings ratio of 3.4 might be too cheap for bargain hunters to ignore.

After all, in 2017 Endo is projected to grow its bottom line by about 10% and its top line by more than 5%, presumably because generic drugs will hit a price floor and the company's other branded products, like Peyronie's disease drug Xiaflex, will continue to post strong sales growth moving forward.

Horizon is attempting to shake the specialty pharma label

Horizon's stock has suffered this year because of the controversy surrounding the specialty pharma model, which relies heavily on acquiring older drugs and subsequently raising their prices by huge amounts. Otherwise, the company's underlying business is arguably in great shape. Horizon's top line, after all, is on track to grow by more than 33% this year and by 13% next year.

While some of the criticism of Horizon's pricing policies is perhaps deserved, the company is working to transform itself into a legitimate orphan-drug maker and moving away from the specialty pharma scene that has drawn the ire of politicians and pharmacy benefit managers alike.

In the first quarter, for example, Horizon reported that 40% of its net sales came from drugs for rare diseases, such as Actimmune, which is indicated for a genetic immune disorder called chronic granulomatous disease. This pivot toward orphan drugs is important, because this particular niche of the drug industry has been largely immune to pricing controversies, even though treatments for rare diseases tend to garner the highest prices of all pharma products.

Horizon boasts a forward price-to-earnings of ratio of less than 8, projected sales growth in the double digits, and a sizable footprint in the valuable orphan-drug space, this biopharma should have what it takes to bounce back soon.

Will Valeant be the ultimate comeback story?

Valeant's incredible downfall has been well-chronicled elsewhere. So, suffice it to say that the company's roughly $32 billion in debt, its recent managerial shake-up, and investigations into its pricing practices have been the main culprits behind the drugmaker's catastrophic 2016.

For serious bargain-hunters willing to overlook some of these issues, though, Valeant does have some tremendous assets that could get the company back on the right track. Its $11 billion acquisition of Salix Pharmaceuticals last year, for instance, brought the newly approved opioid-induced constipation drug, Relistor, into the fold. Although Valeant does have to pay the drug's developer, Progenics Pharmaceuticals (PGNX), royalties and commercial milestones based on annual sales, Relistor is expected to generate peak sales close to $1 billion, which should provide a nice boost to the drugmaker's top line going forward.

Aside from the Salix portfolio, Valeant also owns a highly profitable ophthalmology and eye care franchise through its acquisition of Bausch & Lomb, giving the company a fairly diverse mix of growth products. And given that Valeant is on track to generate mid- to high-single-digit sales growth next year, while its stock trades at a forward price-to-earnings ratio around 3 (no, that's not a typo), a stunning comeback could be in the cards. 

Is it time to pull the trigger on these three stocks?

These three healthcare stocks are anything but safe, despite their dirt-cheap valuations. After all, each company has yet to put its main risk factor in the rear-view mirror. So, if you're a conservative investor, you may want to pass on these specialty pharma stocks for the moment. Investors who are more comfortable with risk, however, might dig deeper into these names.

The bottom line is that Endo, Horizon, and Valeant could all be nearing the end of their trials and tribulations, making them great value buys right now for investors willing to take the long view.