The S&P 500 (SNPINDEX:^GSPC) has nearly tripled since the market lows of 2009, and that index hit its all-time high earlier this month. That's wonderful news for anyone who stuck with it throughout the turmoil that preceded that tremendous run, but it leaves those who are in or near retirement in quite a predicament. The key question on their minds is: Should I stay in stocks or cash out?

After all, corrections happen. Despite the run-up we've had, the market does go down as well as up, and a massive 1987-style crash could wipe out a huge chunk of the wealth you think you have today. While time heals most wounds in the market, retirees and soon-to-be retirees no longer have as much time to rebound from a correction, particularly if they need to draw down their portfolios to survive.

Today's retirees' dilemma
With the stock market near all-time highs and retirees less capable of recovering from a crash than younger investors, the natural choice would be to shift more money into bonds or cash. Unfortunately, in today's low-interest-rate environment, it will be hard to earn sufficient returns on those types of investments both to cover your current expenses and to keep pace with inflation over time.

With neither stocks, nor bonds, nor cash looking like a particularly attractive place to invest your hard-earned money, you're facing quite a dilemma indeed. In today's environment, a retiree or soon-to-be retiree needs to think in terms of purchasing power preservation, rather than wealth accumulation, in order to succeed.

Bonds typically offer lower potential returns than stocks, but they have two advantages over stocks that make them attractive to retirees:

  1. Higher certainty of value: Because their contracts specify maturity date and price and coupon payment terms, bonds have far clearer rules regarding how they should be priced in the market, given prevailing interest rate conditions and issuer credit quality.
  2. Higher certainty of cash flow: A company is typically obligated by its bonds to make the coupon and redemption payments and to show preference for its bond payments over any dividend payments to shareholders.

Those characteristics make bonds attractive candidates for people looking to live off their retirement portfolios. Still, in today's low-interest-rate environment, you'd be hard-pressed to build wealth with bonds. Additionally, if you're expecting a long retirement, bonds alone may not be enough to carry you through unless your nest egg is already sufficient beyond your most estimates. So even if you want to get out of stocks, you may not be able to completely cash out of stocks while fully funding your retirement from your nest egg.

And remember that your Social Security benefit should cover some portion of your expenses, as could any pension you may be eligible to receive. Your investments need only cover the portion of your costs above and beyond those handled by Social Security or a pension.

Ladder your way to a successful retirement
One strategy you can use to balance your need for a certain level of income with your need to keep your nest egg growing is called a "bond ladder." To do this, you:

  • Keep enough in cash/savings to cover your first year's expenses.
  • Buy Treasury bonds or a diversified portfolio of quality investment-grade corporate bonds that mature each year for the next seven to 10 years. Set yourself up so that your portfolio should generate enough cash each year from maturing bonds to cover your expected expenses (adjusted for estimated inflation) for the next year.
  • Keep the rest of your nest egg invested in the stock market to potentially generate the long-term growth you need to replenish the long end of that bond ladder

For an example of how to replenish that long end of your bond ladder, assume you start with a seven-year bond ladder. After a year, your nearest-term bonds will have matured, and the seven-year bonds you originally bought will now have six years left to mature. To keep your bond ladder at seven years long, use the proceeds from your maturing bonds to buy bonds with seven years left before they mature.

In any given typical year:

  • Your expenses get covered by the cash generated from the recently matured bonds.
  • Any additional cash you receive from the coupon payments of your remaining bonds goes to replenish the long end of your bond ladder.
  • If the stock market does well, you sell some stock to help replenish the long end of your bond ladder. If the stock market has a lousy year, you have the option of either replenishing the long end of your bond ladder or letting your investments try to recover by temporarily shrinking the length of that bond ladder.

For instance, if your original plan called for a 10-year bond ladder, as a year passes, those original 10-year bonds now have nine years remaining. If you don't replenish that 10th year from your stocks because of a bad year in the market, you'd still have a nine-year bond ladder -- a similar concept, but simply shrunk by a year. Once the stock market recovers, you can then sell part of the recovered stock part of your portfolio to replenish your bond ladder to your original 10-year target.

Because of the stock market's volatility, a good guideline is that money you may need to cover expenses within the next five years should not be invested in stocks. A seven-year bond ladder on top of one year's worth of cash gives you the ability to withstand three tough years in the stock market. With a 10-year bond ladder on top of that year of cash, you'll be able to cover six rough years in the market.

Key trade-offs and watch-outs
Of course, when it comes to investing, there's no such thing as a free lunch. The more you have invested in your bond ladder, the less you have in stocks and thus the better those stocks have to perform to replenish the long end of your bond ladder. On the flip side, the shorter your bond ladder, the more you're exposed to the risk that a long-term bear market could derail your plans.

Additionally, while bonds offer higher certainty of value and cash flow than stocks, their guarantees are only as good as the issuers behind those guarantees. The further out in time you go, the less that guarantee is worth -- especially as you work your way down the credit-quality spectrum in search of higher current yield. And of course, the farther out the projection you need for your bond ladder, the bigger the impact of the uncertainty in your inflation estimate, too.

The overall objective is to use cash to fund your near-term expenses, quality bonds to cover your midterm future, and stocks to provide for your long-term future. There are no absolute guarantees in the market, and given today's low interest rates and lofty stock market levels, there are few obviously superb investments for retirees.

Still, with a solid and balanced plan that looks to provide sufficient purchasing power to cover your needs over time, you can improve your chances of a financially successful retirement.

Chuck Saletta is a Motley Fool contributor. 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.