Thanks to a solid run in recent weeks, the S&P 500 is no longer in a bear market. But that doesn't change the fact that the index remains down by a double-digit percentage year to date. Investors certainly don't have much reason to have a warm-and-fuzzy feeling about the future, at this point.

CVS Health (CVS -0.22%), though, is easily beating the market so far in 2022. The healthcare-giant's prospects also appear to be improving, based on its second-quarter update. Is CVS Health stock now a buy?

Behind CVS Health's winning ways

It's important to first understand exactly why CVS Health is outperforming the broader market. One likely factor behind the stock's resilience is its valuation.

The S&P 500 currently trades at more than 17 times expected earnings. While that forward price-to-earnings multiple is lower than it's been over the past couple of years, it's still not exactly cheap.

Meanwhile, CVS Health's shares trade at only 11.4 times expected earnings. That isn't just below the S&P 500's level; it's also well under the healthcare-sector's average forward earnings multiple of 16.2.

Investors also likely view CVS Health as something of a safe haven, compared to many other stocks. The company's retail pharmacy, pharmacy benefits management (PBM), and health insurance businesses usually deliver steady cash flow that isn't affected too much by macroeconomic headwinds.

Examples from the second quarter

We saw examples of this stability in CVS Health's Q2 update. The company reported 11% year-over-year revenue growth. 

Pharmacy services, which include the CVS Caremark PBM business, ranked as the top growth driver in Q2, with revenue jumping 11.7% year over year. Specialty pharmacy was the big star in the quarter, with new business wins and higher pharmacy claims generating year-over-year sales growth of close to 21%.

CVS Health's healthcare-benefits segment, featuring big health-insurer Aetna, followed in a close second place, with Q2 revenue up 10.9%. It especially helped that the segment's medical-benefit ratio, which measures medical costs as a percentage of premiums, slid 120 basis points year over year to 82.9%.

The retail/long-term care segment lagged behind CVS Health's other two units but still delivered solid revenue growth of 6.3%. Sales of over-the-counter COVID-19 tests and a longer cold, cough, and flu season helped boost revenue.

CVS also increased its full-year guidance. The company now expects 2022 revenue of between $307 billion and $312 billion, up from its previous outlook of revenue between $305 billion and $310 billion. Adjusted earnings per share are projected to come in between $8.40 and $8.60, compared to the previous forecast of between $8.20 and $8.40.

To buy or not to buy?

Is all of this enough to make CVS Health stock a great pick right now? It depends on your investing style.

CVS Health isn't likely to deliver jaw-dropping growth. Although it's handily outperforming growth stocks in the current environment, that will almost certainly change down the road. As such, growth-oriented investors will probably want to look elsewhere.

On the other hand, more conservative investors will no doubt find a lot to like with CVS Health. The aforementioned attractive valuation and steady growth stand at the top of the list.

There's also the possibility of acquisitions that fuel even stronger growth. CVS Health CEO Karen Lynch noted in the company's Q2 conference call that "inorganic growth is part of our strategy." She said that CVS Health plans to "take a disciplined approach" as it evaluates potential additions to its portfolio.

The company's recent capital-allocation strategy has focused on debt reduction, rather than dividend increases. However, income investors shouldn't turn their noses up at the company's dividend yield of 2.3%, especially in light of its overall stability.

The bottom line is that CVS Health stock looks like a good pick -- at least for some investors. The stock could very well continue beating the market over the next few years.