Image source: Johnson & Johnson.

They're two of the biggies in healthcare. Gilead Sciences Inc. (GILD 0.28%) grew to become the largest biotech in the world over the last decade on the back of its HIV and hepatitis C franchises. Meanwhile, Johnson & Johnson (JNJ 0.82%) has remained the biggest healthcare company overall for years with its consumer products, medical device, and prescription drug segments.

The companies both cooperate with and compete against each other. Gilead and J&J teamed up to develop HIV drugs Complera and Eviplera. In the hepatitis C market, though, Gilead's Sovaldi and Harvoni clobbered J&J's Olysio.

Which of these two giants is the better pick for investors right now? It comes down to potential returns versus risk. Here's how Gilead and J&J stack up against each other. 

Earnings 

What's the biggest driver for stock returns over the long run? Earnings. More specifically, the best stock returns are driven largely by sustained earnings growth in the past with the potential for even higher earnings growth in the future.

Gilead clearly takes the prize for earnings growth over the last 10 years. And the past couple of years have been especially nice for the biotech, thanks to the tremendous success of hepatitis C drugs Sovaldi and Harvoni.

GILD Net Income (TTM) Chart

Future earnings growth is a different story. Analysts surveyed by Thomson Financial Network estimate that Johnson & Johnson's earnings will grow at an annual rate of 6% over the next five years compared to a meager 1.25% annual earnings growth for Gilead Sciences. 

Gilead's main problem is that Sovaldi and Harvoni soared out of the gate but now face more serious competition and pricing pressure from payers. The company boasts a solid pipeline with three drugs awaiting regulatory approval and seven phase 3 clinical trials in progress. However, the potential from these drugs probably won't be enough to offset challenges for its current hepatitis C drugs.

J&J's pipeline includes at least 15 drugs in late-stage clinical studies. The challenge for J&J is that its consumer products and medical device segments haven't performed very well recently, with currency headwinds taking a toll.  

Dividends

Investors don't just make money from stock price appreciation. Dividends play an important role in total returns over an extended period. On this front, Johnson & Johnson stands out as the winner.

It's not just that J&J's dividend yield of 2.84% is higher than Gilead's yield of 2.27%. The real difference on dividends is history. J&J has increased its dividend for 53 consecutive years. Gilead only began paying dividends in 2015. 

Both companies should easily be able to keep those dividend payments coming. Gilead's dividend payout ratio, which reflects the percentage of net income that a company pays out to shareholders in the form of dividends, currently stands at a super-low 14.7%. J&J's payout ratio of 54.7% is higher, but it's still at a healthy level.

Risk

Buying any stock comes with risks. Some risks are greater than others, though.

Gilead's biggest risk stems from its dependence on Harvoni and Sovaldi. The two drugs combined for 58% of the biotech's total revenue last year. We've already discussed how the challenges for Gilead's hep C franchise could hurt earnings growth over the next few years. There's also the possibility that key drugs in Gilead's pipeline stumble -- either in the regulatory approval process or in their commercial launches. 

J&J doesn't have to worry much about having too many eggs in one basket. Not only does the company have three business segments, but each of those businesses has many products on the market. Probably the main risk for J&J is sluggish growth that causes its stock price to languish.

And the winner is...

My pick as the better buy is Johnson & Johnson. It's likely that your great-grandparents bought J&J products and that your great-grandchildren will too. I like J&J's diversification -- and absolutely love its dividend.

However, I like Gilead Sciences also. The big biotech could face challenges in the days ahead, but I expect Gilead will put its large cash stockpile to good use. I also think that with a forward earnings multiple under 7, most of Gilead's risks are already baked into the share price.

I own shares of Gilead directly and own shares of J&J indirectly through an exchange-traded fund that has the stock as its top holding. Both of these stocks should be winners for investors with a long-term perspective.