Fears of a looming recession are frequently on the minds of investors these days as soaring inflation rates continue to cause problems for the economy. And it's hard to call any stock "recession-proof," since one way or another, a decline in employment levels and consumer spending has the potential to disrupt every business in the country.

There are, however, some stocks that can be safer buys than others if a recession hits. One stock that risk-averse investors may want to consider is CVS Health (CVS -1.58%). The top healthcare company has solid fundamentals, a diverse business, and a relatively high-yielding dividend.

A market-beating stock in the Great Recession

A good test of a stock's endurance is to check how it performed during the largest prolonged downturn, the Great Recession, which took place more than a decade ago. Although CVS Health's stock declined during the period of December 2007 through June 2009, it outperformed the S&P 500. During that time frame, CVS' total returns (including dividends) were negative 23%. While that's not great, it's better than the S&P's negative total returns of 34%.

The healthcare stock closely followed the markets, but for the most part, its returns were normally higher than the index's. Given the pharmacy retailer's relative stability and the ongoing need for pharmaceuticals and healthcare regardless of the state of the economy, it may not be a surprise that it was a better-than-average investment. During that time frame, CVS remained profitable and was a good buy.

CVS Revenue (Quarterly) Chart.

CVS Revenue (Quarterly) data by YCharts.

It could be an even better buy this time around

CVS did well during the Great Recession, and its business was smaller and less diverse than it is today. Now, the company generates about $80 billion in revenue every quarter and profits of over $2 billion each period. It acquired health insurance company Aetna in 2018, which has made its business even more diversified and a safer buy.

And CVS is looking to get even bigger, recently announcing that it would be acquiring home health company Signify Health for $8 billion. It's also looking at potentially buying a primary care business.

The company is getting deeper and more entrenched in healthcare, which is one of the most stable industries for investors to gain exposure today. And so, by becoming a larger and more diversified healthcare company, CVS becomes less risky overall while growing its top and bottom lines as well.

A solid dividend to sweeten the deal

Investors fearing a recession may also appreciate the stock's solid payout. At 2.4%, the dividend yield is higher than that of the S&P 500 average of 1.8%. Although the company hasn't consistently been raising its dividend, it's been moving in the right direction, standing at more than three times the $0.1625 that CVS was paying its shareholders a decade ago.

CVS Dividend Chart.

CVS Dividend data by YCharts.

Is CVS stock a buy?

Year to date, shares of CVS are down 8%, which is modest against the S&P 500's drop of 20% this year. Again, the healthcare stock is proving to be a better buy than the markets as a whole. It's a trend that I don't see letting up, not as the company becomes more diverse and a more profitable business.

While this may not be an exciting enough stock for growth investors to rally behind, CVS does make sense as an investment for risk-averse investors looking for a safe stock to hold in the event of a downturn.