Between February and October 1945, the Dow Jones Industrial Average advanced by 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 it still unclear whether the economy is out of recession for good or will dip back downward, it's worth reflecting on what that uncharacteristic market 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 by 21.3%.

Investors who are quick to head for the exits simply because there's 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.

This time around, investors who bought stocks when the recession was first officially announced in December 2008 have done handsomely, getting in near the bottom and catching the entire rally since March 2009. Yet that won't always happen. You might experience a little volatility or find yourself waiting a period of months before seeing any capital appreciation. But that's the nature of the markets -- sometimes they rise, sometimes they fall, and sometimes they go nowhere.

Market timing is useless
Of course, recessions aren't always good for stocks. From December 2007, when economists say the recession started, to March 2009, stocks fell precipitously. And historically, during recessions, stocks have more often declined than advanced. But the notion that recessions always destroy returns is not the case.

After all, some companies behind consumer luxuries will tend to see a big squeeze. If the economy is tough, penny-pinching consumers cut back on perceived luxuries. Coach (NYSE: COH), for instance, saw its fiscal 2009 revenue rise by just 2% after 20%+ gains in 2007 and 2008. Mercedes-maker Daimler (NYSE: DAI) saw 2009 revenue drop by 20%. In addition, consumers delay big-ticket items, a trend that contributed to a 30% loss of annual revenues at furniture retailer Ethan Allen Interiors (NYSE: ETH) during its 2009 fiscal year.

The economy, though, still needs to function at some level. People will still need to eat, do laundry, brush their teeth, buy medicines, and so on. That's how Colgate-Palmolive (NYSE: CL) and Kimberly-Clark (NYSE: KMB) continued to see net income increase during 2009 -- all the while paying attractive dividends and seeing their share prices hold up reasonably well even during the depths of the market meltdown.

Moreover, consumers have to buy somewhere. That made McDonald's (NYSE: MCD) a good candidate to weather a recession; with consumers paying closer attention to their pocketbooks, the company's perception as a place for bargains gives it a leg up. And even though revenue dipped slightly during 2009, the company grew earnings by 5.5%.

Recessions develop over time. There is no set formula that reveals to us when a recession begins and when it ends. Even though some have said the recession is over, others think we're still in it and that we could see things get worse before they get better. Yet as those on the sidelines know all too well now, waiting for the "end" will often lead to waiting until it's too late and missing 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 also rewarded in the following year. Those who wait it out on the sidelines -- until the headlines provide a cheery consensus -- later come to realize they've missed a whole lot of the party.

Don't fall for bad stocks. Fool contributor Chuck Saletta explains why this stock is worthless.

This article, written by Sham Gad, was originally published on Feb. 6, 2008. It has been updated by Dan Caplinger, who doesn't own shares of the companies mentioned. Coach is a Motley Fool Stock Advisor recommendation. Kimberly-Clark is a Motley Fool Income Investor recommendation. Try any of our Foolish newsletter services free for 30 days. The Fool has a disclosure policy.