The path to a comfortable retirement is fraught with peril, but none so great as volatility. Image: Wikimedia Commons user Ondrej Zvacek.

I want you to imagine two different scenarios with me. For the first, let's assume you're 40 years old and want to retire by age 65. Here are two different views of what market returns could look like over the next quarter-century

We'll oversimplify for the sake of this article and say that you start with $100 invested and add $100 every year. In the end, which scenario would you rather have?

Knowing that you won't be touching that money until you retire, you would likely choose the volatile returns. Your nest egg would be over twice as large.

What if you were in retirement?
Now let's take a different view. Let's say the market's returns -- both steady and volatile -- will be the same as they were in the above scenario. The only difference is that now you've reached age 65, and you need the money to last you until age 90.

We'll say you were a diligent saver and have amassed $1 million. In the first year, you'll withdraw 4% of your nest egg for living expenses, and then adjust that number by 3% per year to keep up with inflation.

Remember, the market returns are exactly the same as above. Which scenario do you choose now?

It's almost mind-boggling how differently these two situations play out -- to the point that you might believe I've made a serious error with my math. But I assure you this is correct. If you opt for volatile returns in retirement, you'll end up broke by age 90!

How in the world can we explain this?

The difference between volatility and risk
I could talk until I'm blue in the face about the difference between risk and volatility, and I still probably wouldn't be able to emphasize it enough.

When you are working, you are in the accumulation phase of your investing life. Volatility not only doesn't hurt you, but can actually juice your returns. That's because you are a net buyer of stocks. So long as you aren't selling when the market goes down, volatility is absolutely not a risk to you.

However, once you hit retirement, the scenario flips. You are now in the distribution phase of your investing life, and market volatility is not your friend. In fact, it's an enormous risk. That's because you are a net seller of stocks. So even when stocks are low, you still have to sell some of your holdings to live off them. And that's the absolute worst time to be forced to sell.

You will never recover the money you lost by selling out. And if those downwardly volatile years occur at the beginning of your retirement, it's a blow from which you might never recover.

How to avoid volatility in retirement
Hopefully, this makes it clear that as you enter retirement, controlling for volatility is important. In many ways, once you retire, you become a quasi-short-term investor; you know you'll be selling some stocks every year.

Fortunately, there are several ways to mitigate the effects of volatility.

One of the most tried-and-true approaches is to shift your holdings from stocks to bonds. Though the payout over the long run is lower, the returns from bonds are generally positive after inflation and are much less volatile than stocks.

But that doesn't mean you need to abandon stocks altogether. A portion of your holdings should be dedicated to solid, dividend-paying blue-chip stocks like Coca-Cola (NYSE:KO), Procter & Gamble (NYSE:PG), and Johnson & Johnson (NYSE:JNJ). These three companies all pay dividends yielding more than 2.8% and have betas under 0.54, meaning they are far less volatile than the overall market. These three are also considered noncyclical holdings, which means that people tend to buy their products -- beverages, soaps and shampoos, and Band-Aids, for example -- no matter the economic climate.

Investors nearing and in retirement need to make sure their holdings are diverse enough -- not only between stocks and bonds, but also within the types of stocks they hold -- to ensure they limit overexposure to highly volatile assets such as commodities and speculative plays.

In the end, that approach will help you enjoy your retirement in comfort, rather than spending the last years of your life worrying about where your next paycheck might come from.

Brian Stoffel owns shares of Johnson & Johnson. The Motley Fool recommends Coca-Cola, Johnson & Johnson, and Procter & Gamble. The Motley Fool owns shares of Johnson & Johnson and has the following options: long January 2016 $37 calls on Coca-Cola and short January 2016 $37 puts on Coca-Cola. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.