"Past performance does not guarantee future results."

The line that inhabits nearly every review of historical market performance often proves true, at least to a certain extent. But following a recessionary period, the stock market has typically done extremely well:

Statistic

Median Value

Length of Recession

11 months

Time From Recession's Start to Market Low

6 months

Return From Market Low to End of Recession

25.2%

Source: Fidelity Investments. Figures are the median values for all recessions since 1926.

Buy when others are fearful ...
The historical trend above suggests that those who entered the market each time the economy looked ugly were handsomely rewarded. It also reveals why Berkshire Hathaway (NYSE:BRK-A) (NYSE:BRK-B) shareholders have greatly benefited from Warren Buffett's mantra to be greedy when others are fearful.

As our economy progresses through each cycle of ups and downs, so does the stock market. But the two do not necessarily move in tandem. Measures of economic activity are lagging indicators. They inform investors about what has already happened.

The market will adjust accordingly to new data if expectations prove incorrect. However, because analysts and investors are always predicting what will happen, their forecasts are incorporated into market prices, and major market fluctuations are based on changes in what investors envision for the future.

Falling behind the eight ball
The most recent activity in the stock market and U.S. economy exemplifies this idea.

Toward the end of 2007, stock prices began their downward spiral. The housing and credit markets were inflated and key factors driving the growth of our economy began to weaken. The general market slowly began to assume that the U.S. was entering a downturn.

Yet, it wasn't until over a year later, December 2008, that the National Bureau of Economic Research confirmed that our economy was in recession. By that time, the S&P 500 had already fallen by nearly half from its peak in October 2007.

Investors waiting for the "official word" that the economy was in trouble were too late. The damage was already done. Those prepared for the downturn had already shifted their assets accordingly. In fact, in the four days after NBER announced the recession, the S&P 500 rose over 10%.

The early bird gets the worm
The stock market also rises in anticipation of recovery. Short bouts of drastic upswings and downswings typically occur along the way as market participants gather more information on the prospective revival of the economy. But the best returns are earned by investors willing to make the first move and ride out the bumps as the rest of the market catches up to the idea of a recovery.

The following chart provides evidence that a large portion of the rallies that follow recessions occur in the very early stages of recovery.

Time After Market Low

Average Share of Total Bull Market Gains, 1930 to 2008

1 month

12.3%

3 months

17.9%

6 months

26.6%

9 months

33.4%

12 months

41.5%

Source: Fidelity Investments.

Put another way, on average, more than a third of all bull market gains came during the first nine months of bull markets. That means you can't afford to be late to the party.

Those figures are consistent with experience. For instance, after the tech boom collapsed, investors were reluctant to buy back into the sector. The brave folks who dove back in early by selecting and holding onto top-notch companies like Amazon.com (NASDAQ:AMZN) and eBay (NASDAQ:EBAY) were rewarded with triple-digit returns. But those who waited saw much smaller gains.

Likewise, investors willing to venture into the most-shunned sectors during the recent collapse will likely be compensated generously in the coming quarters. But that doesn't mean you can go out and buy stocks like Toll Brothers (NYSE:TOL), Citigroup (NYSE:C), or Crocs (NASDAQ:CROX) willy-nilly just because their shares took big hits.

Finding stocks that will survive and eventually thrive requires meticulous due diligence, since many companies within the banking, housing, and consumer sectors are still teetering on the edge. Investors must decipher whether a company has fundamental problems specific to it or whether it is just struggling through a rough patch in the economy.

Our economy is in recession, and it's far from being out of the woods. But if history repeats itself, then now is the time to buy.

Berkshire Hathaway, Amazon, and eBay are all Motley Fool Stock Advisor selections. Berkshire Hathaway and eBay are Inside Value recommendations. The Fool owns shares of Berkshire Hathaway. Try any of our Foolish newsletters today, free for 30 days.

Kristin Graham does not own shares of any of the companies mentioned in this article. The Fool has a disclosure policy.