You don't have to be an economics expert to suspect that a recession could be on the way. However, there are more than a few such experts making that prediction these days.

Warren Buffett has weathered plenty of economic downturns during his decades of investing. Unsurprisingly, his Berkshire Hathaway (BRK.A -0.22%) (BRK.B -0.18%) portfolio includes several stocks that are relatively recession-resistant. Here are three Buffett stocks that should beat the market during a recession.

1. Johnson & Johnson

Johnson & Johnson (JNJ -0.04%) stands out as one of the steadiest blue chip stocks on the market. The healthcare giant, like Buffett, has survived and thrived through decades of ups and downs. J&J has also increased its dividend during these periods, with 60 consecutive annual dividend increases.

That track record of stability is especially attractive to investors during recessions. To be clear, Johnson & Johnson hasn't always defied gravity during economic downturns. But it has typically outperformed the S&P 500 in previous recessions. The stock is also beating the market so far this year as concerns about the economy have increased.

J&J does face a challenge: Blockbuster psoriasis and psoriatic arthritis drug Stelara will lose U.S. exclusivity in the second half of next year. However, CFO Joe Wolk said on the recent Q3 conference call that the company still expects to grow its pharma business to $60 billion in sales by 2025.

Overall, Johnson & Johnson's business should remain resilient. Its medications and medical devices will continue to sell regardless of what happens with the economy. The company is on track to spin off its consumer health unit in late 2023, a move that investors should welcome.

This stock isn't the favorite for Buffett that it once was. However, Berkshire still owns a stake in J&J even after exiting positions in several other drugmakers. Buffett probably likes its stability as much as other investors do.

2. McKesson

McKesson (MCK -0.29%) is one of Buffett's more recent additions; Berkshire opened a position in the healthcare stock earlier this year. That turned out to be a smart move. McKesson's shares have soared more than 50% so far in 2022.

Can the stock continue to beat the market if the economy enters a recession? Probably so. McKesson has outperformed the S&P 500 in several previous recessions. For example, the stock rose during the recession of 2001. It also didn't fall nearly as much as the broader market during the Great Recession of late 2007 through mid-2009, or the coronavirus-caused recession of 2020.

McKesson's business has proven to be remarkably strong despite rising inflation and supply chain issues. Revenue from the company's U.S. pharmaceutical segment continues to grow, thanks largely to the increased demand for specialty products in the U.S. In the latest quarter, this segment was by far the biggest moneymaker for McKesson, generating nearly 85% of total revenue.

Perhaps the biggest wild card for McKesson is what happens with COVID-19. The company's contract with the U.S. government as a centralized distributor for COVID-19 vaccines goes through July 2023. However, the stock should still be able to continue its winning ways.

3. Procter & Gamble

Berkshire had a much larger position in Procter & Gamble (PG -0.01%) in the past. But P&G is the kind of business that Buffett tends to like -- solid but not exciting.

It's also the kind of stock that often holds up quite well during recessions. P&G didn't fall nearly as much as the S&P 500 did during the Great Recession or during the brief 2020 recession. So far this year, the consumer staples stock's decline is roughly in line with the S&P 500.

Why has P&G delivered a lackluster year-to-date performance? Its revenue growth has come from raising prices instead of increasing volume. P&G anticipates continued headwinds into 2023.

Still, P&G has several things going for it. Like Johnson & Johnson, it's a Dividend King. The company's products are household names, and this brand familiarity gives P&G a competitive advantage. This stock probably isn't the perfect pick for a potential recession, but it should nonetheless beat the market.