Looking over the past one- and 10-year periods, shares of Johnson & Johnson (JNJ -0.46%) have outperformed the S&P 500 benchmark, while GlaxoSmithKline plc (GSK 0.32%) stock has performed much worse. Past performance, however does not guarantee future success.

GSK Chart

Perhaps the market has been too far too kind to J&J or too harsh on Glaxo. Let's look at opportunities and challenges facing both companies and dig into the numbers a bit to decide which is the better buy.

Growth focus
Consumer goods aren't terribly exciting, but strong brand recognition isn't subject to patent cliffs, either. J&J's U.S. sales of over-the-counter drugs, including Tylenol and Sudafed, grew 13% last year to over $1.5 billion. Last year, Glaxo's consumer healthcare sales grew 44%, mostly from the new joint venture with Novartis

Of course, nobody purchases drugmakers for the slow, steady growth of their consumer goods -- it's groundbreaking new therapies that get investors' blood pumping.

Image source: Johnson & Johnson.

J&J has no shortage of success on this front. Its share of sales from blood cancer pill Imbruvica, now partnered with AbbVie, more than tripled to $689 million last year. In the years ahead I'm expecting J&J's share of annual Imbruvica sales to reach $5 billion. Another FDA label expansion made it the first chemo-free option for not-yet-treated patients with the most common form of leukemia.

Beyond cancer, J&J's Invokana is the market leader in a new class of type-2 diabetes pills that are just beginning to take off. Last year Eli Lilly showed that its pill in the same class significantly reduced patients' chances of being hospitalized or dying from cardiovascular causes. Lilly's was the first glucose-1 lowering therapy to show such a benefit, but J&J's continued sales growth with Invokana suggests, for now, the medical community is considering it a classwide effect.

Invokana sales more than doubled to $1.3 billion last year, while Lilly's barely registered. The battle to treat the diabetic masses is far from over, but Invokana's growth story might be in its beginning chapter.

Since its peak in 2007, Glaxo's annual revenue has fallen more than $10 billion to $36.6 billion last year, and the slide may continue. Advair's sales of $5.6 billion last year was only about 30% off its 2013 peak, and new respiratory products aren't gaining traction fast enough to offset the losses. Perhaps that's why Sir Andrew Witty, who's been CEO throughout the revenue slide, will be leaving Glaxo next spring.

Strangely enough, Glaxo's one bright spot is a segment it considered spinning off. Although the rest of its HIV products fell hard last year, sales of Tivicay more than doubled to $900 million. Sales of Triumeq, a combination containing Tivicay approved in August 2014, exploded last year, reaching $1.1 billion.

GSK Revenue (Annual) Chart

At this rate the nearly spun-off HIV segment could more than offset Advair losses, but it will be a long time before Glaxo's top line returns to growth.

In contrast, I expect J&J's sales to hit another peak next year. The company lost $1.6 billion in sales last year because its hepatitis C antiviral Olysio immediately became obsolete following approval of Gilead Sciences' combination pill, Harvoni. Also, a rising dollar turned a 1.8% gain at constant currency into a 5.7% decline in sales. I can't tell you if the dollar will continue its rise, but I'd say J&J's chances of returning to top-line growth next year look pretty good.

Dividend focus
European companies generally take a different approach to dividends than U.S. investors are used to. Steady raises aren't as much of a priority, and they're fond of special dividends -- the recent sale of oncology assets to Novartis resulted in a big one recently. Glaxo also declares its dividend in pence, and the rising dollar hasn't done any favors for ADR holders. Its dividend yield of 5.8% may be enticing, but if you're expecting it to continue growing steadily, you could be in for an unpleasant surprise.

JNJ Payout Ratio (TTM) Chart

At a glance, the percentage of profits Glaxo used to make dividend payments, or payout ratio appears fairly low at just 49%. It's important to note a $16 billion cash injection from Novartis skewed the ratio. Look a bit deeper and you'll see "core" earnings-per-share last year of 75.7 pence was below the 80 pence ordinary dividend. Without an uptick in earnings soon it's hard to see how Glaxo will continue making such big dividend payments in the years ahead.

GSK Dividend Chart

In contrast, only 11 companies can boast of a longer streak than J&J's 53 consecutive annual dividend increases, but none are as large by market cap, or sport a AAA credit rating. Although with J&J's 2.8% yield you might do better with Glaxo, unless it slashes its dividend as it did about 15 years ago.

Value focus
Given the recent sale of oncology assets to Novartis, and expected Advair losses, and its eventual generic competition, in the years ahead it's not surprising that Glaxo's shares are only priced at 7.6 times trailing earnings.  By the same measurement, J&J shares are far more expensive. However, at about 19.6 times trailing earnings. they're well below the S&P 500 average of 23.6.

GSK PE Ratio (TTM) Chart

You never want to see a company's forward P/E ratio higher than its trailing P/E ratio. Seeing Glaxo's nearly twice as high is just heartbreaking, even if it's largely due to the sale of oncology assets.

All told. Glaxo is a bit cheaper than J&J on a forward basis, and the dividend yield is tempting. However, given J&J's legendary stability combined with its promising pipeline, I have to say it's the better buy.