Patent expiration, clinical trial failures, and innovation make investing in biotech stocks tricky, and as we've seen, not even the biggest biotech companies are immune to setbacks. For example, Gilead Sciences (NASDAQ:GILD) is among the most successful drug developers in the world, yet its share prices have fallen because of high-profile stumbles. Is this beaten-up biotech a top stock to buy now?

The next big thing

Gilead Sciences made a name for itself by developing medicines that battle against HIV, and in 2014 it reshaped how doctors treat hepatitis C when it launched Sovaldi and Harvoni -- two drugs that changed the likelihood of achieving a functional cure from a coin flip chance to a near certainty.

A man in a suit with a green dollar sign floating above one upturned palm and a red dollar sign floating above his other upturned palm.

Image source: Getty Images.

At its peak, Gilead Sciences' hepatitis C drugs were bringing in nearly $20 billion in annualized sales, however, the company's been a bit of a victim of its own success. As more hepatitis C patients were functionally cured by its drugs, demand for hepatitis C drugs dropped off. As a result its hepatitis C drug sales fell to $9.1 billion in 2017 from $14.8 billion in 2016.

Dwindling hepatitis C sales has been a big drag on the company, but there's reason for some optimism.

Despite its declining revenue, the company's still massively profitable. Its 54% operating margin is miles above Celgene and AbbVie's 36.2% and 34%, respectively, and as a result Gilead Sciences generated $11.3 billion in free cash flow and $4.6 billion in net income over the past 12 months.

Its profitability affords it envy-inspiring financial flexibility, and so far management's used that flexibility to fund the development of a new autoimmune disease drug, filgotinib, and to acquire a cancer gene therapy platform.

Gilead Sciences' licensed filgotinib, a highly selective JAK1 inhibitor, from Galapagos in 2015. The two companies believe filgotinib's selectivity will allow it to improve upon prior JAK therapies that have secured FDA approval and trials are currently ongoing in multiple autoimmune disease indications. The drug hasn't proven itself in late-stage trials yet, but phase 3 results in rheumatoid arthritis are expected later this year. If those results are good, then it wouldn't be a stretch to think filgotinib could be a billion-dollar blockbuster.

Scientists smile as they work with petri dishes.

Image source: Getty Images.

The gene therapy platform also offers the company an important new source of sales. Gilead Sciences spent $11.9 billion last fall to acquire Kite Pharma to get its hands on Yescarta, which has since won an FDA OK for use in tough-to-treat lymphoma patients. Yescarta, which costs in the hundreds of thousands of dollars per patient, could add hundreds of millions of dollars in revenue to Gilead Sciences' top line. The company's opportunity isn't limited to lymphoma, either. Gilead Sciences' studies are evaluating Yescarta and other gene therapies in leukemia, multiple myeloma, and solid tumor cancers, too.

Admittedly, there's no guarantee those trials will pan out, but the flurry of activity could lead to the next big advance for the company and that could reignite revenue and the company's share price.

A bargain or a value trap?

Perhaps the biggest reason to consider adding Gilead Sciences to portfolios is its valuation. Its hepatitis C struggles are arguably already reflected in its share price, and as a result investors are paying only about 3.8 times sales and 11.7 times forward earnings per share right now. On a price to sales basis, the company's much cheaper than competitors Celgene and AbbVie.

GILD PS Ratio (TTM) Chart

GILD PS Ratio (TTM) data by YCharts

In terms of its forward P/E ratio, it's only a little pricier to buy than Celgene, which has a forward P/E ratio of 10.4, and it's cheaper than AbbVie, which has a forward P/E ratio of 12.5.

At first blush, its price to sales and P/E ratios suggest this company's a bargain. However, sales would have to level off here and analyst's forecasts would need to stick around current estimates or improve for that to be true. Unfortunately, that may not be the case.

Yescarta could help stem the revenue slide, but it's unlikely to offset all of the drag caused by declining hepatitis C sales, and for that reason Gilead Sciences' guidance is for sales of $20 billion to $21 billion this year, down from $25.7 billion in 2017. The company's EPS outlook is a bit hazy too. Over the past 90-days, industry watcher's EPS estimates have slipped to $6.46 from $6.81 for 2018 and they've fallen to $6.64 from $6.71 for 2019.

Until Gilead Sciences' sales and profit stabilize, its share price will depend a lot on its forthcoming filgotinib data in rheumatoid arthritis and its immuno-oncology studies. Unfortunately, the potential for those trials failing still makes buying Gilead Sciences shares risky, regardless of their valuation.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.