Who could blame you for being skittish about the stock market? It sank roughly 40% back in 2008, and despite its subsequent rise, it's been whipping sharply up and down over the past few months. So far this month, the Dow Jones Industrial Average (INDEX: ^DJI) shed more than 5%, falling from 11,614 to 10,992. Yikes. You may want to flee to cash until the storm passes, but that would probably be a mistake.

A recent MFS survey found that 40% of those aged 18 to 30 "will never feel comfortable investing in the stock market." Unfortunately for them, taking your ball and going home isn't the best idea.

No one knows when the market will plunge or surge. Sitting on the sidelines can keep you from enjoying considerable gains. Look at the S&P 500's returns over the following years:

Year

S&P 500 Return

1995

38%

1996

23%

1997

34%

1998

29%

1999

21%

2000

(9%)

2001

(12%)

2002

(22%)

2003

29%

Source: Standard & Poor's.

Remember that the market's long-term annual average return is roughly 9% to 10%. After a 38% gain in 1995, it would have seemed reasonable for investors to move to cash, right? A big gain in the following year would have seemed unlikely. But 1996 was another big year. And those who got out after those two huge gains lost out on three more years of outsized gains. Then, in 2003, those who were reluctant to invest in stocks after three years of major losses lost again, forfeiting a gain of 29%.

For those of us with long investing horizons, it's best to just stay put -- and to keep adding money to the market.

Missed opportunities
Following the 2008 stock market implosion, if you'd waited until you were sure it was safe, you'd have missed out on 2009's 27% gain. With individual stocks, you'd have missed out on more or less than that. For example:

Company

2008 Return

2009 Return

New York Community Bancorp (NYSE: NYB)

(26%)

30%

lululemon athletica (Nasdaq: LULU)

(83%)

280%

Altria (NYSE: MO)

(30%)

39%

Cisco Systems (Nasdaq: CSCO)

(40%)

47%

Source: Morningstar.

Back in 2009, some investors shunned big banks in favor of smaller ones. New York Community Bancorp didn't need or take any bailout money, and it kept up its dividend payments. On the retail front, lululemon athletic was posting strong revenue growth numbers despite a shaky economy.

Altria also rebounded quickly in 2009. It helps that tobacco is a defensive industry, with literally addicted customers. My colleague Morgan Housel predicted that Altria would do well at the beginning of the year, noting that its dividend yield at the time was a whopping 8.4%. Back in 2009, the company was boosting its smokeless tobacco business, having bought UST in 2008.

Cisco Systems was another company we expected to do well; it had fallen to rather undervalued levels, sported little debt and robust profitability, and was partnering with VMWare (NYSE: VMW) and EMC on system servers. Since 2009, though, the company has struggled -- and it's now fallen enough to once again look like a bargain.

Hello, volatility
Volatility is nothing to be scared of. Investors can measure stocks' volatility via their "beta," which reflects how much more volatile than the overall market they are. Consider Silver Wheaton (NYSE: SLW). Its beta of 1.6 suggests that, on average, its stock is 60% more volatile than the overall market.

As long as a company is healthy and growing, that unpredictability can be just fine. Silver Wheaton tumbled a severe 62% in 2008, but came roaring back by 131% in 2009. Investors at the time found themselves more attracted to the perceived safety of precious metals such as gold and silver, which made companies such as Silver Wheaton more appealing. Its "flawless performance" didn't hurt, either; the miner posted record numbers for sales, production, earnings, and cash flow.

Shrinking dollars
Leaving your assets in cash won't simply rob you of opportunities like those above. It can also allow inflation to eat away at your assets. Inflation has averaged about 3% per year, topping the interest rates of bank accounts and CDs these days, as well as many bonds.

But despite their sluggish gains, those latter investments are the right option under certain specific circumstances. If you'll be needing some of your funds in the next few years, don't keep them in stocks. The market may tank abruptly, leaving you without enough time to wait for it to rebound. Also, if you just don't know what you're doing in stocks, or you don't understand what your various holdings do and how healthy they are, you'd do well to sell them.

For most of us, though, whether we're in promising stocks or a simple broad-market index fund or two, it's best to stay put. Just look at the occasional downturn as a great opportunity to add more shares at depressed prices.

Looking for strong defensive stocks? In the free report " 5 Stocks The Motley Fool Owns -- And You Should Too ," my fellow Fools highlight one of the most defensive, best-performing stocks of all time.