The key question facing investors right now is whether the COVID-19 pandemic and the social isolation measures being taken to combat it will tip the economy into a deep and extended recession. Right now, the extent of the damage that coming is still hard to accurately predict.

But, assuming that a long downturn is imminent (or has already begun) investors can get some protection against it by buying stocks of companies that have proved resilient during previous recessions. In this context, auto parts retailer O'Reilly Automotive (NASDAQ:ORLY), contact lens manufacturer The Cooper Companies (NYSE:COO), and animal health company Zoetis (NYSE:ZTS) are worth a look.

O'Reilly Automotive

Auto parts retailers are traditionally seen as recession-resistant. Consumers are more likely to defer purchases of new vehicles during economic downturns, which means they have to keep their older ones running. And the longer those older cars are kept on the road, the more they will need repairs and replacement parts.

A man holding a shield against a price chart.

Protect your portfolio from a recession by buying stocks that can increase earnings in a downturn. Image source: Getty Images.

During the 2008-2009 recession and its aftermath, O'Reilly's same-store sales growth accelerated. 

O'Reilly Automotive same store sales growth.

Data source: O'Reilly Automotive. YOY= year over year. Chart by author.

That said, it might seem somewhat puzzling that shares of the major auto-parts retailers are down significantly in 2020. That's possibly down to concerns that the sudden cessation in economic activity caused by social isolation measures -- and the steep drop-off in the number of miles being driven -- will heavily impact their sales.

That's certainly true in the near term. However, given the likelihood that the COVID-19 pandemic will ultimately be contained, it's highly likely that light vehicles will be back on the road, and at that point, O'Reilly's sales could recover -- recession or no recession. As such, the recent drop in the share prices of auto parts retailer has created what appears to be some good buying opportunities for investors.

ORLY Chart

Data by YCharts

The Cooper Companies

People still need to drive their cars in a recession. They also still need to see, which means that those who wear contact lenses have to keep buying them. That's clear from the results Cooper delivered during the last recession -- the company grew sales and earnings all the way through it. This makes Cooper an attractive stock to look at if you are looking to hedge against a poor economy.

However, buying Cooper for the long-term isn't just a defensive play. In fact, the company has a number of long-term earnings drivers that make its stock worth looking at. For example, an aging U.S. population is likely to lead to higher demand for eyesight correction products. In addition, Cooper is seeing strength in sales of its silicone hydrogel lenses -- more technologically advanced lenses that allow more oxygen to reach the eye.

There's also an opportunity for Cooper to grow sales of its 1-Day modality lenses in the Americas. The 1-Day modality only accounts for 46% of the frequent-replacement market in the Americas (the rest goes to two-week or monthly modality) compared to 54% globally.

Intriguingly, there's even a possibility that the COVID-19 pandemic will lead to a shift in consumer preference toward the 1-Day modality as those rapid disposables are seen as a cleaner option compared to two-week and monthly disposable lenses, which must be cleaned on a regular basis. Perhaps on the next earnings call, management might report whether they are seeing signs of such a trend.

The Cooper Companies revenue and earnings.

Data source: The Cooper Companies. Chart by author.

Zoetis

Zoetis was spun out of pharma giant Pfizer in 2013, so it's not as easy to get a clear picture of how its components performed during the last recession. In addition, Pfizer added the animal health business of Wyeth to its portfolio with its acquisition of the company in 2008. Nevertheless, digging into Pfizer's SEC filings shows that its legacy animal health product sales were flat on a currency-adjusted basis in 2009 and increased 4% in 2010. That's a good result during a major recession. 

To be fair, the animal health business isn't completely recession-resistant. High unemployment could result in people taking their pets to veterinarians less often, and if farmers are financially constrained, they could reduce investment in livestock. That said, the evidence from Pfizer/Zoetis during the last recession is that animal health spending is not that cyclical --  so it's still a good industry to hedge with during a recession.

Moreover, Zoetis has powerful long-term trends propelling it forward. The combination of a growing global population, increased urbanization, and growing middle classes in developing countries is adding up to a significantly higher demand for protein. That's good news for the company's livestock-focused sales such as anti-infectives, vaccines, feed additives, and parasiticides. Meanwhile, companion-animal-focused sales can grow thanks to the increasing willingness of consumers to spend on their pets.