I bought my shares of Johnson & Johnson (JNJ 0.67%) and Gilead Sciences, Inc. (GILD -1.15%) long ago, when they were trading far lower than they are today. If I had to choose one to keep and one to let go of, I'd probably pull out what's left of my hair first.

After watching the path both have taken over the past couple of years, though, choosing the best stock to buy at the moment isn't nearly as nerve-racking. The stocks have run in opposite directions: Johnson & Johnson has outpaced the red-hot S&P 500 with a gain of about 40% over the past two years. Gilead Sciences shares have sunk about 29% over the same time frame. 

Man in a suit contemplating two arrows painted on a wall, pointing in opposite directions.

Image source: Getty Images.

So which stock is poised to provide a better return over the long run? Read on to find out.

Shareholder kindness

A 55-year track record of consecutive annual dividend increases makes Johnson & Johnson an easy stock to own. The latest 5% bump raised the annualized payout to $3.36 per share, which works out to a yield of about 2.5% if you buy the stock at recent prices.

Gilead's dividend program is an infant compared to J&J's, but it will probably deposit more cash into your brokerage account over the next several years. The stock offers a slightly larger yield -- 2.7% at recent prices -- and more room for large increases. Despite back-to-back 10% annual dividend bumps, Gilead needed just 16% of profits generated over the past four quarters to make the higher payments.

Johnson & Johnson's trailing-12-month payout ratio of about 54% after raising its dividend at around half the pace isn't necessarily bad. You just have to realize that Gilead Sciences has been off-the-charts profitable since launching next-generation pills that essentially cure hepatitis C patients after about two or three months.   

To get a handle on just how much cash Gilead's hepatitis and HIV antivirals generate, look at this chart:

GILD Free Cash Flow (TTM) Chart

GILD Free Cash Flow (TTM) data by YCharts.

For nearly two of the past three years Gilead actually generated more free cash flow than J&J despite being several times smaller by market cap. This has allowed Gilead to splash out on share repurchases that lowered its share count by a whopping 13.7% over the past three years.

J&J's share buybacks, which lowered its share count by about 4.1% over the same time frame, are respectable. They just don't hold a candle to Gilead's overt displays of affection for its shareholders.

Looking ahead

Both of these companies are made up of many parts moving in different directions. Unfortunately, one of Gilead's largest parts has been moving in the wrong direction. Sales of the company's treatments for hepatitis C virus (HCV) fell to $2.9 billion during the second quarter from $4.0 billion during the previous year period.

Millions of people live with HCV infections for years before symptoms push them to seek treatment. This has made finding a bottom for falling HCV sales difficult, but it looks like the worst is over. In July Gilead revised 2017 HCV sales expectations upward to a range between $8.5 billion and $9.5 billion from a range between $7.5 billion and $9.0 billion provided in February.

With sales from consumer health brands, medical devices, and pharmaceuticals, Johnson & Johnson's revenue stream is a lot more stable than Gilead's. Unfortunately, the conglomerate's single largest revenue stream has been losing ground as well. In the second quarter, sales of J&J's aging anti-inflammatory drug Remicade came in 14% lighter than last year at $1.5 billion, or about 8% of J&J's total revenue for the three-month period.

The better buy now

Johnson & Johnson's blood cancer drug Imbruvica is a scorching success, while recently launched Tremfya, a psoriasis treatment, is expected to generate around $3.5 billion in annual sales at its peak. With big drugs like Remicade pulling in the opposite direction, though, the average Wall Street analyst expects the company's bottom line to grow at an annual rate of just 6.3% over the next five years.

Relatively modest growth projections make J&J stock look a little expensive at a recent price about 22.3 times trailing earnings. Gilead's stock has surged recently, but at around 9.0 times trailing earnings it's much cheaper than J&J shares. 

If Gilead's HCV sales stabilize, it would give its next-generation HIV treatments, and the cell-based cancer therapies it plans to acquire from Kite Pharma a chance to help the company's top line return to growth. One candidate under review at the moment, Axi-Cel, is expected to generate about $2.5 billion in annual sales at its peak.

With a larger dividend, a much lower valuation, and a chance to return to significant growth in the years ahead, Gilead Sciences is the better stock pick at the moment.