The major benchmarks traded in a narrow range on Tuesday. The Dow Jones Industrial Average (DJINDICES:^DJI) briefly moved above the 23,000 mark and closed short of that, but still at a record, and the S&P 500 (SNPINDEX:^GSPC) also closed at a record.

Today's stock market

Index Percentage Change Point Change
Dow 0.18% 40.48
S&P 500 0.07% 1.72

Data source: Yahoo! Finance.

Healthcare stocks advanced on positive earnings news, with the Health Care Select Sector SPDR ETF (NYSEMKT:XLV) gaining 1.3%. Retail stocks were also strong; the SPDR S&P Retail ETF (NYSEMKT:XRT) rose 0.76%.

Two components of the Dow Jones Industrials provided a boost to that index after reporting earnings. UnitedHealth Group (NYSE:UNH) and Johnson & Johnson (NYSE:JNJ) both delivered pleasant surprises to investors.

Rising stock graph on a red background.

Image source: Getty Images.

UnitedHealth makes the right moves

Insurer UnitedHealth announced quarterly results this morning, and the company met expectations for revenue and soundly beat earnings projections, sending the stock up 5.6%. Revenue was up 8.7% to $50.3 billion, and adjusted earnings per share grew 23% to $2.66. Analysts were expecting EPS of $2.56. 

As expected, revenue took a $1.6 billion hit from the company's decision to pull out of the Obamacare individual insurance exchanges, knocking a full 4 percentage points off the revenue growth rate. But that loss was more than offset by strong profit performance from the company's Optum unit, which grew earnings from operations by 15.7%, thanks to double-digit profit growth from each of its three segments. Net margin for the overall company improved from 4.3% last year to 4.9% this quarter.

"In 2017 we have been fortunate to serve the healthcare needs of more customers and consumers in increasingly diverse ways, and we expect the opportunities to do so will grow even further in 2018, 2019 and beyond," said David S. Wichmann in his first earnings press release since taking the reins as CEO last month.

UnitedHealth's strategic decisions are paying off for shareholders, as the company increased the dividends paid out by 22% compared with the quarter last year, and has repurchased $1.17 billion in shares so far this year. With a stock that has risen 29% in 2017, today investors applauded a business that is giving them healthy returns indeed.

Johnson & Johnson's third quarter: Just what the doctor ordered

Healthcare giant Johnson & Johnson surprised analysts with third-quarter results that beat expectations on both the top and bottom lines, triggering a 3.4% jump in shares. Sales increased 10.3% to $19.7 billion, handily beating the average forecast of $19.3 billion, and adjusted earnings per share rose 13.1% to $1.90, compared with a consensus estimate of $1.80 in earnings per share. 

The standout business this quarter was pharmaceuticals, with revenue up 15.4%, 7.9% of which came from the acquisition of Actelion and 0.8% attributable to currency gains. Sales of medical devices increased 7.1%, and the consumer business recorded a 2.9% sales gain. The company boosted its guidance for full-year revenue about half a percent to a range of $75.8 billion to $76.1 billion and its EPS guidance to $7.25 to $7.30, about 1.5% higher than guidance given last quarter, and above the $7.18 analysts had been expecting.

"Johnson & Johnson accelerated growth in the third quarter. This is driven by the strong performance of our Pharmaceutical business, and augmented by Actelion and other recent acquisitions across the enterprise that will continue to fuel growth," said CEO Alex Gorsky in the press release.

Johnson & Johnson has a loyal following of investors that appreciate this Dividend Aristocrat for its consistency and shareholder-friendly payouts, but in recent years, slowing growth has been worrisome. The market cheered today's announcement, which held signs that the growth outlook for the company is improving.

Jim Crumly owns shares of Johnson & Johnson. The Motley Fool owns shares of and recommends Johnson & Johnson. The Motley Fool recommends UnitedHealth Group. The Motley Fool has a disclosure policy.