Between February and October 1945, the Dow Jones Industrial Average advanced 21.3%. Must have been a time of prosperity or a bubble, right?

Nope. Would you believe that this performance occurred during a recession? With the "recession" buzzword floating around these days, it's worth reflecting on what that uncharacteristic behavior can teach us. Before you buy the hype, take a look at how the stock market has actually performed during and following recessions in the past.

Recessions aren't "bad"
Contrary to popular media opinion, not every single recession is bad for the investor. In the 1945, 1953-1954, and 1980 recessions, stock market returns behaved as if they were in a period of prosperity. As mentioned, during the recession of February to October 1945, the market actually jumped 21.3%.

Investors who are quick to head for the exits simply because there is a recession looming are forgetting one very important fact: The principal goal of an investor is to focus on acquiring strong businesses selling at attractive prices -- regardless of the market environment.

While you might experience a little volatility or find yourself waiting a period of months before any capital appreciation, that's the nature of the markets. Markets rise and markets fall ... and sometimes, markets go nowhere.

Market timing is useless
Of course, recessions aren't always good for stocks. The current downturn is a great example of this, and more broadly, advancing markets were outnumbered by declining ones. But the notion that recessions simply destroy returns is not necessarily the case.

Sure, some companies behind consumer luxuries may be squeezed. If the economy is tough, penny-pinching consumers might cut back on perceived luxuries from Tiffany (NYSE:TIF) jewelry to their daily Starbucks (NASDAQ:SBUX) fix, or they may delay replacing old vehicles with new ones, hurting automaker companies like Ford (NYSE:F). Indeed, that's part of the reason why these stocks have been hurt over the past few months.

The economy, though, still needs to function at some level. People will still need to eat, do laundry, brush their teeth, buy medicines, etc. This bodes well for dividend-paying consumer-staples powerhouses such as Procter & Gamble (NYSE:PG), Johnson & Johnson (NYSE:JNJ), and Kraft Foods (NYSE:KFT).

Moreover, consumers have to buy somewhere. That makes even Wal-Mart (NYSE:WMT) a candidate to weather a recession; with consumers paying closer attention to their pocketbooks, the retailer's perception as a place for bargains gives it a leg up.

Recessions develop over time. There is no set formula that reveals when a recession begins and when it ends. We are currently in a recession, but no one knows how long it will last. Waiting for the "end" will often lead us to wait until it's too late and thus miss out on a great buying opportunity. So the key, again, is to buy quality issues for cheap and be patient.

Invest in the company first, not the market cycle.

It's not the end of the world
What's most important about recessions is at some point, they cease and things pick up. You'd never guess that during a recession -- there's too much noise pronouncing doom and gloom.

But the facts speak for themselves. Not only do they end, but investors who exhibit patience are rewarded in the following year. Those who wait it out on the sidelines -- until the headlines provide a cheery consensus -- later come to realize that they joined the party shortly before midnight.

Learn more about value investing:

If you're ready to buy quality on the cheap -- and then to be patient -- consider a free trial of our Motley Fool Inside Value investing service. We specialize in identifying cheap, durable, out-of-favor stocks that Wall Street simply isn't willing to look at. You can take a look at our lineup of recommendations (which are beating the market) with a no-obligation 30-day trial. Click here for more information.

This article, written by Sham Gad, was originally published Feb. 6, 2008. It has been updated by Dan Caplinger, who owns shares of Starbucks. Johnson & Johnson, Kraft Foods, and Procter & Gamble are Motley Fool Income Investor selections. Starbucks and Wal-Mart are Motley Fool Inside Value picks. Starbucks is a Motley Fool Stock Advisor selection. The Fool owns shares of Procter & Gamble and Starbucks. Try any of our Foolish newsletters today, free for 30 days. The Fool has a disclosure policy.