It takes months for the experts to tell exactly when a recession has ended, but more and more economists believe the latest one came to a close this fall. What, then, can investors expect over the next year or so?

Nothing is guaranteed, but history has shown that stocks tend to dramatically outshine bonds in two key periods: the six months before a recession ends and the six months after.

When the sectors are broken down, the results are as many people might expect; safer investments like bonds and big-company stocks weather the storm better than riskier investments like junk bonds and small-company and foreign stocks. Riskier investments tend to take the lead as the end of a recession appears near and investors become bolder.

An analysis by Ned Davis Research, Inc. looks at the 14 U.S. recessions from 1925 to 2001. The average lasted 13.9 months and the longest, the whopper that started in 1929, for 44 months. The recent recession will probably turn out to be the second longest. It began in December 2007 and lasted about 20 to 22 months, if the latest estimates are right.

The National Bureau of Economic Research calls the dates but can only do so months after the fact because it takes time to gather firm numbers. A recession is defined as “a significant decline in economic activity spread across the economy, lasting more than a few months.” Key gauges are gross domestic product, unemployment, industrial production and wholesale and retail sales.

While there are exceptions, bonds tend to do well during recessions and stocks poorly. During the past 14 recessions bonds gained an average of 9.88%. Stocks almost always endure bear markets at some point during a recession, though they often eek out a gain before the recession ends. In eight of the 14 recessions, stocks ended higher than they’d started, but the average gain was only 2.82% and moves were very volatile.

But stocks really begin to shine as investors sense the economy is about to improve. In the six months before a recession ends, large-capitalization stocks, reflected by the Standard & Poor’s 500, returned 12.96%. In the six months after the end, they returned 16.78%. Long-term Treasury bonds returned 8.32% and 1.13% in the six months before and after recessions’ ends.

Small-capitalization stocks, representing small companies, currently measured by the Russell 2000, have done especially well in the six months after the end, returning 31.29%.

TST Recommends

Growth stocks tend to beat value stocks in the six months before a recession ends, but value beats growth in the six months after.

The best-performing stocks during recessions, including the final six months, tend to be consumer staples and health care, the worst utilities and energy. But in the six months after a recession ends, the best performers tend to be energy and materials stocks.

U.S. stocks generally do better in recessions than foreign stocks. Foreign stocks are often hammered, thought they do eventually recover, outperforming U.S. stocks in the second six-month period after a recession ends.

During a recession, investment grade corporate bonds and U.S. government bonds outperform high-yield, or “junk” bonds, but high-yield bonds do better after the recession.

Recessions always end at some point. In fact, for investors, the end point is crucial, as recoveries tend to come very quickly. The S&P 500, for instance, typically matches its previous peak just 7.5 months after hitting bottom during the recession.

If history is a guide, the lion’s share of the recovery may already be over in the most recent recession, since the trough was reached in March, nearly nine months ago.

Taken together, the analysis suggests two types of investors can handle a recession best. First are nimble and insightful traders who can predict the peaks and valleys. Second are the buy-and-hold types who just stick with their holdings through the downturn and have everything in place for a recovery, regardless of when it occurs.

—For the best rates on loans, bank accounts and credit cards, enter your ZIP code at