After suffering through the "lost decade" for stocks, investors were taken on a roller-coaster ride in recent weeks -- and the future looks to hold more of the same: a highly volatile stock market and lower annual average returns.

You'd think that might mean that investors whose main goal is a comfortable retirement should be anywhere but in stocks.

Not so.

Despite the bleaker outlook going forward, the stock market is still about your only hope of overcoming the bite that inflation and taxes will take out of your retirement savings.

"The future real (after-inflation) return of a traditional mix of stocks and bonds may be closer to 2% than the 5% average of the past," said Chris Brightman, the head of investment management at Research Affiliates in Newport Beach, Calif.

And the ride will be bumpier. Brightman said the annualized standard deviation of monthly stock-market returns was 15% for the past decade, up from about 10% in the 1990s and 1960s. Still, he said, "the average recent volatility of 14% to 15% is only slightly higher than the 13% to 14% level during the 1970s and 1980s." Since 1831, the average is 14.5%.

But despite the weak -- and volatile -- outlook, people investing for retirement need stocks.

"We're likely to be living in a more volatile period for some significant period of time, and I believe market returns are likely to be relatively modest compared to what they have been," said Harold Evensky, the president of money-management firm Evensky & Katz in Coral Gables, Fla. "I still think they're going to be higher than what someone is going to get in bonds. That's the reality investors have to live with."

Others agree. "You can't get to a retirement goal earning 2% or 3% in bonds when inflation is running at 3.5%," said Jeff Layman, the chief investment officer at BKD Wealth Advisors in Springfield, Mo. "The impact of that is much more devastating on a portfolio over time than periodic rounds of volatility."

This doesn't mean you must throw 70% of your retirement-plan assets into stocks. Your precise allocation will depend on such factors as how many years out from retirement you are and your ability to ignore the daily headlines and focus on the long term.

What's most important is diversifying across a broad array of asset classes, rebalancing regularly and controlling your expenses.

Maybe you envy your neighbor who moved all his money into cash in July or early August, before the gut-wrenching gyrations of the Dow Jones Industrial Average ($INDU).

Certainly, your neighbor was not alone. Plenty of people have been jumping out of stocks in response to the U.S. debt-limit debacle, Europe's debt crisis, ongoing fears of a new recession and a general crisis of confidence.

Investors pulled a net $13 billion out of equity mutual funds in the week ending Aug. 3 -- that's the week before four massive Dow moves -- up from the net $9.3 billion investors withdrew a week earlier and the less than $4 billion pulled out in each of the first two weeks of July, according to the Investment Company Institute, a mutual-fund company trade group.

Sure, your neighbor seems prescient. But does he know when to get back in? "Markets go up just as precipitously and as fast as they go down," Evensky said.

Retail investors are known for pulling out of the market -- and then missing the rebound. From 1991 through 2010, the average annual return of the Standard & Poor's 500 Index ($INX) was 9.1%, but the average equity investor return was a measly 3.8%, according to Dalbar, a provider of market research.