Image source: Getty Images.

Pharmaceutical stocks have been hammered over the past year, leaving potential buyers with a plethora of potential bargains. At Johnson & Johnson (NYSE:JNJ), pharmaceutical sales have taken off, but consumer goods and medical devices still comprise the majority of its total revenue. Eli Lilly (NYSE:LLY) is more of a pure play for those seeking pharmaceutical exposure, with a prominent position in the growing diabetes space.

With these key differences in mind, let's compare the two companies on a handful of metrics to see which is the better buy.

The products

When it comes to first-quarter sales this year over last, Eli Lilly has Johnson & Johnson beat. Lilly recorded $4.87 billion in the first quarter, a 5% increase, or about 8% if you exclude unfavorable currency fluctuations. When J&J last reported, first-quarter sales had risen just 0.6% (or 3.9% if you want to overlook negative currency impact) to $17.5 billion.  

Image source: Eli Lilly.

Lilly's sales rose mostly on the back of the somewhat recent type-2 diabetes injection, Trulicity, and aging cancer therapy Erbitux. Trulicity sales popped from $18.3 million in Q1 2015 to $143.6 million in the latest quarter, proving it can compete with Novo Nordisk's extremely popular drug in the same class, Victoza.

First-quarter Erbitux sales rose 90% over Q1 2015, to $168.1 million. Unfortunately the gain was largely due to last April's transfer of rights to U.S. sales from Bristol-Myers Squibb. The drug first won approval in 2004, and few expect it to drive growth for Lilly in the years ahead. 

While Lilly has some recent launches pushing up sales, Humalog, currently the company's leading source of sales, is pulling them down. The main U.S. patent for the insulin injection expired in 2013, and first-quarter sales slid 11% over the same period last year, to $606 million.

Johnson & Johnson's product mix is far more diverse, but few bright spots in its medical-device and consumer-goods segments left growth to its pharmaceutical division. That segment contains more than a few potential winners. For example, first-quarter Stelara sales rose 33.9% to an annualized run rate of about $2.9 billion, despite the recent crowding in its psoriasis indication.

Also growing quickly are sales of J&J's next generation type-2 diabetes pill, Invokana. Eli Lilly has a drug in the same class, Jardiance, that it just can't seem to get off the ground. Lilly's Jardiance finished the first quarter on a run rate of just $152.8 million, while J&J's Invokana is on pace to reach about $1.3 billion this year.  

The pipelines

Recent approvals of Imbruvica -- J&J's blood-cancer pill on which it's partnered with AbbVie -- to first-line solo treatment of the most common form of leukemia could push sales of this drug into the stratosphere. For the first time, newly diagnosed patients have a chemotherapy-free option. This landmark could more than double J&J's portion of Imbruvica sales from its current annualized run rate of about $1 billion.

Image source: Johnson & Johnson.

A little further ahead, a more recent collaboration between J&J and Denmark's Genmab has enormous potential in the multiple myeloma setting. Darzalex won approval last November for treatment of multiple myeloma patients who have progressed following three other treatments, but recently announced results should help it become a first-line standard in this indication.

Adding Darzalex to a current standard combination of Celgene's Revlimid and dexamethasone, in patients who had already progressed following at least one treatment, more than doubled the rate of complete responses. The median patient receiving the standard treatment progressed after 18.4 months, but the trial was halted early following a planned interim analysis because the improvement in progression-free survival among the group also receiving Darzalex was already strong enough to be considered significant. That's about the best news you can hope for in a cancer study, and annual sales estimates topping $5 billion aren't so far-fetched.

Last month, Lilly claimed it could potentially launch 20 new products over the next 10 years. One of the more promising candidates is baricitinib for treatment of rheumatoid arthritis. Lilly is doing most of the heavy lifting with the anti-inflammatory it licensed from Incyte, and it just might pay off.

The once-daily pill is under review at the FDA, and recently announced results show it might have a slight edge over AbbVie's popular Humira, after long-term use. Although it wasn't the study's main goal, after 52 weeks, 68% of patients given baricitinib and methotrexate reported clinically meaningful improvement in physical function, compared with 58% of patients receiving Humira and methotrexate. 

Although Humira is the world's best-selling drug, peak sales estimates for baricitinib of about $2 billion are fairly generous, considering how crowded the anti-inflammatory space is becoming.

The dividends

Johnson & Johnson recently announced its 54th consecutive annual dividend raise, up 6.7% to to $0.80 per quarter. At recent prices, the yield of just 2.7%  is just a bit below the 2.8% Lilly's shares offer.

JNJ Dividend Chart

JNJ Dividend data by YCharts

Eli Lilly froze its distribution for several years, and needs nearly all its profits to make the recently increased payments. With this in mind I really don't think it's worth the extra 0.1% yield today.

The value

At recent prices, Lilly's P/E of about 34 times trailing earnings is awfully lofty. If it can't deliver on its promise to launch all those new drugs over the next 10 years, you might see some losses.

JNJ PE Ratio (TTM) Chart

JNJ PE Ratio (TTM) data by YCharts

Based on this year's estimates, the two companies are much closer in price, but Lilly is still awfully expensive given the amount of unknowns. With much smaller operations than J&J, if some of Lilly's pipeline assets turn out to become big winners, you could see a nice return over the long run.

At this point, you should know that investors who bought into Lilly about 15 years ago are still sitting on losses. On a per-share basis, Lilly's trailing earnings are 25% lower than they were 10 years ago.

Recent stagnation in Johnson & Johnson's medical-device and consumer-goods segments dampen the potential growth in its pharmaceutical pipeline might provide, but they also kept it from falling off a patent cliff, as Lilly and many of its Big Pharma peers have.

If Lilly shares weren't trading at such a premium, it might make sense, but overall I think Johnson & Johnson is a far better buy, both for your anxiety level over the next several years and for retirement income in the decades ahead.

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.