Shares of Johnson & Johnson (JNJ -0.46%) rose 6% in a single trading session last week as investors responded to a second-quarter earnings report that was far more positive than they were expecting.

Of course, one good quarterly report on its own isn't a great reason to buy J&J or any business. Let's take a closer look at J&J's recent performance in light of the major shakeup that occurred earlier this year to see if the stock is a good buy now.

An encouraging post-spinoff performance

In February, J&J spun off its consumer health segment into a new company named Kenvue. J&J still owns 90% of Kenvue shares, but J&J shareholders will soon have the option to exchange some, all, or none of their J&J stock for shares of the new company.

Now that the slow-growing consumer division is no longer holding it back, it probably makes sense to hang on to as many J&J shares as you can. If we adjust for rapidly dwindling COVID-19 vaccine sales and shifting currency exchange rates, pharmaceutical segment revenue rose 6.2% year over year in the most recent quarter.

The end of COVID-related restrictions is fueling an uptick in long-delayed surgeries and in turn, J&J is selling a lot more medical devices than usual. Medtech sales surged 14.7% year over year at constant currency exchange rates in the quarter. The recent acquisition of Abiomed, a manufacturer of tiny pumps that keep blood flowing during heart surgery was a strong contributor.

Somewhat stronger-than-expected contributions from its pharmaceutical and medical technology segments encouraged management to raise its estimate for 2023 adjusted earnings. At the midpoint of the new range, adjusted earnings are expected to rise 6% year over year instead of the 5% gain management predicted three months earlier.

A repeatable strategy

Over the past year, J&J reported $16.2 billion in free cash flow. This is significantly less than it reported when its COVID-19 vaccine was in high demand but still more than enough to meet its dividend obligations and acquire new sources of growth.

Strong cash flow allowed J&J to meet its dividend commitment and pay around $16.6 billion in cash for Abiomed. Revenue directly related to the Abiomed acquisition is on pace to top $1.4 billion this year. With help from J&J's huge international sales force, Abiomed-related revenue could grow faster than ever.

Over the past 12 months, J&J needed just 73% of the free cash flow its operations generated to pay dividends. A growing pile of cash and cash equivalents that finished June at $29 billion means it can pull off another strategic acquisition as soon as one presents itself.

A person looking at stock charts on their computer screen.

Image source: Getty Images.

Reasons to remain cautious

Jettisoning its slow-growing consumer health division could allow J&J's bottom line to increase its pace. That said, cash flow from consumer items like Q-Tips, Band-Aids, and Listerine, are fairly reliable. Cash flow from the new, slimmed-down J&J will probably be a lot more volatile.

While J&J has several blockbuster drugs with increasing sales, that growth is getting stifled by older products that have lost patent protection. In addition to declining COVID-19 vaccine sales, second-quarter sales of Zytiga, a prostate cancer treatment, slid 55% year over year to $227 million.

Imbruvica, a blood cancer treatment that once generated more than $5 billion in annual sales for J&J, is losing market share despite maintaining patent protections. Two similar but younger treatments, Calquence from AstraZeneca, and Brukinsa from Beigene, have been attracting blood cancer patients with arguably better safety profiles. Pressure from these competitors caused second-quarter Imbruvica sales to fall 13% year over year to an annualized $3.4 billion.

A buy now

Despite bounding higher after the latest earnings call, shares of J&J are currently trading at 15.8 times earnings expectations. This is a very reasonable price to pay for a business that expects to grow earnings per share by 6% this year at the midpoint of management's guided range.

Buying some shares of J&J now, and tucking them away for the long run gives investors a decent chance to outperform over time. This probably won't be the best-performing asset in your portfolio, but it's still a smart buy because the odds of losing money over the long run are extremely slim.