With many economists and financial-market pundits predicting that the U.S. is heading for, or is already in, a recession (although the data hasn't caught up yet), the question about what investors should do with their cash always comes up.

At The Motley Fool, we'll never recommend that you try to time business-cycle movements, pull up all your investments, and hide in a cave whenever a recession is looming around the corner. After all, searching for value in a beaten-down market has been a hallmark of success for many top investors like Warren Buffett.

So, what stocks should investors with cash to invest look for in a tough economic environment? I can't speak for all sectors, but historically, large-cap drugmakers such as GlaxoSmithKline and Johnson & Johnson (NYSE: JNJ) have proved to be very resistant to the downturn that many stocks take in a recession.

Mergers and acquisitions have changed the look of the pharmaceutical and biopharma sectors dramatically in the 1990s and 21st century, but an index consisting of today's largest U.S. publicly traded pharmaceutical and biotech drugmakers would have outperformed the broader market indices like the S&P 500 dramatically in the past two recessions.

Show me the data
According to the National Bureau of Economic Research, the U.S. has been involved in two recessions in the past 20 years. Both recessions were eight months long, and the first occurred from July 1990 to March 1991, with the second recession going from March to November 2001.

Below is a chart of how shares of the largest drugmakers of today have performed in both of these recessions. The drugmakers used for this homemade pharma and biopharma index are all of the largest drugmakers that have been around since 1990 in their current forms and publicly listed on either the Nasdaq or New York Stock Exchange.

This list includes Merck (NYSE: MRK), Pfizer (NYSE: PFE), Johnson & Johnson, GlaxoSmithKline, Abbott Labs (NYSE: ABT), Wyeth (NYSE: WYE), Bristol-Myers Squibb, Eli Lilly, Schering-Plough, Genentech, and Amgen (Nasdaq: AMGN), but it excludes some of today's large drugmakers born out of megamergers -- names such as Novartis and Sanofi-Aventis -- because they didn't exist in 1990. It also excludes companies not listed on the major U.S. stock markets, such as Roche.

Without further ado, here's how this pharma index performed versus the S&P 500 index and the Dow Jones Industrial index during both of the last recessions:

Returns During July 1990 to March 1991 Recession

Returns During March to November 2001 Recession

All large-cap drugmakers



Large-cap drugmakers minus biotech



S&P 500 index



Dow Jones Industrial index



Looking at the above chart, we see that the homemade large-cap pharma index destroyed both the S&P 500 and the Dow in the 1990-91 recession, and while I wouldn't call the negative returns that this pharma index experienced in the 2001 recession a good performance, single-digit percentage losses definitely beat the painful double-digit percentage drops in the broader markets.

This homemade pharma index isn't without criticism, though. Being able to put together this index assumes you were able to pick which drugmakers back in the early '90s would have remained or become the top pharmas and biotechs of the land today. Most of the drugmakers in my index were among the largest pharmas and biopharmas 18 years ago, but it was a different ballgame back then, especially for the biotechs on my list.

One point of note, compiling the data for my chart could have been much easier if there were dedicated pharmaceutical and biotech indices back then, but neither the AMEX pharma nor AMEX biotech indices existed yet during the '90-'91 recession. Both the AMEX pharma and biotech indices did beat the S&P 500 and Dow Jones in the last recession, though, with returns of -4.6% and -5.9%, respectively.

What does all this mean for investors?
For investors willing to pull up their sleeves and doing a little dirty work looking at SEC filings, investing in individual large-cap pharma stocks is one way to play defensive in the recessionary environment that we're probably in. With a large-cap drugmaker, not only do you get the benefit of a bit of safety in a recession, but many drugmakers like Gilead Sciences (Nasdaq: GILD) also would make excellent long-term investments in any business-cycle environment.

Not all drugmakers will perform well over the coming years, but for investors just wanting exposure to the pharma or biotech sectors, there are also multiple exchange-traded funds available, such as the Pharmaceutical HOLDRs that track the pharma or biopharma sectors. Even better, most of them pay a dividend yield that would make our Income Investor team smile.

More defensive Foolishness: