Many companies featured on Money advertise with us. Opinions are our own, but compensation and
in-depth research may determine where and how companies appear. Learn more about how we make money.

Money is not a client of any investment adviser featured on this page. The information provided on this page is for educational purposes only and is not intended as investment advice. Money does not offer advisory services.

slow road sign
Anders Clark—Getty Images

When you're investing for retirement, your main task is to establish a long-term goal and plot out a portfolio that will get you there. But it's also crucial to be on guard against major disasters. One of the most critical impediments you need to be wary of: running into a bear market just as you're about to retire.

That's because suffering even modest losses early in retirement—we're talking about as little as a 10% decline in the first year of withdrawals—can prematurely deplete a seemingly solid investment plan.

Unfortunately for investors who are nearing retirement, the market looks to be entering bear territory. True, the 14% decline in the S&P 500 index from May 2015 through mid-February didn't qualify as a bona fide bear market (the technical definition is a 20% drop). But the likelihood that a sustained downturn is lurking ahead appears to be growing stronger.

Consider that this bull market is now more than seven years old and only one rally in history has lasted longer—the one that ran from December 1987 to March 2000. (And you know what happened then: The market entered a 2½-year bear that cut stock values in half.) Add to this the fact that equities aren't cheap, the U.S. economy remains stuck in a low gear, and China's economic engine appears to be seizing up. It's only logical to assume that at the very least major potholes and hazards lie ahead.

Watching your portfolio bounce around is unnerving at any age, but it's especially tough for those who are near retirement or have just made the transition.

But take a breath. While retiring into a downturn can be dangerous, "it presumes retirees just set their plans and then never change them for the next 20 or 30 years," says David Littell, co-director of the retirement-income program at the American College. "That's not what people do. They adjust."

Adjustment, however, doesn't mean you should exit the market. "Retirees who bailed out of stocks and never got back into the market or waited too long have missed a lot of important growth" since the 2008 bear, notes T. Rowe Price financial planner Stuart Ritter. Here's what you should do instead:

Ease back on stocks—for now

As you segue into retirement, you know to ratchet down your exposure to equities. But rather than starting with a typical 50% or so in stocks and reducing that weighting as you age, consider the case for taking the "glide path" less traveled.

Retirement security expert Michael Kitces and Wade Pfau, a professor of retirement income at the American College, suggest dropping to an even more conservative stock allocation early in retirement—as low as 30% or so. Then when you get past the first few years, gradually increase that to as much as 60% over 15 years to ensure that your nest egg continues to grow in retirement.

Going ultraconservative at the outset serves a purpose: A 30% stock/70% bond portfolio kept losses down to single digits in some of the worst bears in history. Minimizing the effects of market crashes not only protects your nest egg, but also will make it less likely that you'll feel so stressed that you'll make rash decisions that undermine your long-term goals.

There's an especially strong case for lightening up on stocks now. After rallying for seven years, equities have become expensive and remain so, even after the recent slide. History says the more expensive stocks are, the lower the likely gains you can expect from them in the future.

Historically, the price/earnings ratio for stocks, based on 10 years of earnings—a method popularized by Yale economist and Nobel laureate Robert Shiller—has averaged about 16. Today this "cyclically adjusted" P/E ratio (CAPE) is more than 24. A study by AQR Capital Management found that when the market's CAPE hovers at this level, stocks have averaged annual inflation-adjusted gains of just 0.9% over the subsequent decade.

Not surprisingly, Research Affiliates forecasts the S&P 500 will deliver real annual returns of just 1.2% over the next 10 years, well below the long-term market average of 7%. "Given where valuations are, it's not a bad thing to get defensive," says Kitces, a principal at Pinnacle Advisory Group.

Indeed, an overvalued market like this lends itself to a conservative strategy that grows more aggressive over time. That's because to trim your equity stake below 50%, you would have to scale back on stocks at a time when they're expensive (in other words, sell high). Then over time, as corporate earnings grow while stock prices struggle, you would be adding to your equity allocation as P/E ratios improve (buy low).

Whichever glide path you choose—the traditional route or the one Kitces and Pfau recommend—the odds are good that your nest egg will last at least 30 years if you follow a conservative withdrawal strategy.

Cut back on low-grade stocks

If you are five years or so from retiring and are looking to begin ratcheting down, begin by funneling fresh retirement contributions into bonds and cash for the remainder of your career. But the next step is to pare down equities in your existing portfolio. Where to start?

Jettison the most vulnerable stocks in a potential bear market. That includes funds that focus on more speculative fare—companies with potential but little or no profits (think of biotech companies such as Vertex Pharmaceuticals or cloud-computing giant Salesforce.com ) or sizable debt (such as Boston Scientific ). In anxious markets, investors also have little patience for frothy stocks, especially if there's another market scare. This explains why small-cap growth-stock funds—with an average portfolio P/E of more than 25 based on projected earnings, vs. around 16 for the broad market—have fallen 16% over the past year. That's about 10 percentage points more than the S&P 500.

Hang on to high-quality shares

In choppy markets, "high-quality" stocks tend to hold up better than speculative fare. These are companies with stable earnings, low debt, and a history of being able to deliver shareholder returns regardless of market conditions. From last year's market highs to the February lows, Money 50 fund PowerShares S&P 500 High Quality ETF (SPHQ) lost less than 6% while iShares MSCI USA Quality Factor ETF (QUAL) sank 8%. Both held up better than the 14% decline of the S&P 500 during that time.

Dividend payers are another way to cope with a bear market, especially for retirees who are tapping their portfolios for income. "With dividend stocks and bonds, you can get a yield of more than 3%, and that gets you close to your income needs, so you don't need to worry much if the market goes down," says Scott Bishop, director of financial planning at STA Wealth Management in Houston. SPDR S&P Dividend ETF (SDY) and PowerShares International Dividend Achievers ETF (PID), which are both in the Money 50 list of recommended funds and ETFs, yield 2.6% and 4.8%, respectively.

Fuel up on high-grade bonds too

After years when investors worried about income in a low-yielding market, the focus has shifted to the other role bonds play—providing ballast. That means it's time to lighten up on low-quality bonds, where defaults are on the rise. Moody's predicts that junk bond defaults will hit 4.4% this year, the highest level since 2010.

While junk bond funds offer higher yields than investment-grade debt, they've fallen 8% on average on a total return basis over the past year. By contrast, Vanguard Total Bond Market Index Fund (VBMFX), which holds only high-grade debt, is up 1.2% during this stretch.

If your bond stake is tucked into a high-quality fund or ETF tied to the Barclays U.S. aggregate bond index, like Vanguard Total Bond, you've got plenty of bear protection. The median return for this index when stocks are falling is a 5% gain. True to form, when stocks sank 37% in the 2008 market crash, Vanguard Total Bond returned 5.1%.

Don't avoid all risk

Stocks in Europe and Japan are expected to see 15% greater volatility than U.S. shares, according to Research Affiliates. Emerging-markets stocks may be 60% bumpier. Yet this doesn't mean you should avoid foreign equities, since a bear market in the U.S. does not mean other global markets must follow suit.

And owning international stocks is not just a smart long-term diversification move, but it also comes with a kicker—they're cheap right now. Research Affiliates forecasts foreign stocks in mature markets will deliver a 5.9% annualized real return over the next 10 years and emerging-markets stocks could return 8.6% a year. Because of the volatility, though, limit your total foreign stake to 30% or so of the money you keep in equities.