The stock market is in bear market territory -- or a downturn of almost 20 percent that can last weeks, months or years. In any bear market, you have no idea when it will end or how bad it will get. So investors naturally get scared.

On rare occasions, such as 2000-2002, the stock market can drop almost 50 percent. Investors, throughout history, have recovered from the worst periods if they have retained diversified portfolios of stocks and bonds, but in the midst of the bear market the question is always: When?

On average investors have gained back what they lost within about 2.5 years, according to the Leuthold Group, which has studied bear markets throughout stock market history. After the 2000-2002 crash, investors did not recover what they lost for about five years.

So as you follow the news, you may wonder if you should flee. You might also simply freeze, unable to figure out what to do.

Try to avoid both, and force yourself to look at your investments.

As surprising as this might seem, you should not take your cues from the stock market. Rather, you should be guided by the types of investments you need, and how long you have before you will have to get your hands on the money.

Here are some tips that will help you think this through:

Do you have an emergency fund? Money for an emergency -- like a job loss -- should not be invested in the stock market. That was as true last year when the stock market was climbing as it is today.

The rule of thumb is to invest no money in the stock market that you might need within about five years. Another rule of thumb: Always have three to six months of cash in a high yield savings account, money market fund or CDs, so you can get your hands on it quickly if you need it. If it's in stocks, and the stock market drops 25 percent, you could have a shrinking pot of money when you most need it.

Will your child be going to college soon? If your child is in college or about to enter college, that money should not be in stocks or stock mutual funds. You don't want your savings to get chopped by a quarter, a half, or any large number when the Bursar's office is expecting a check.

It's still OK to invest heavily in stock mutual funds if your child is young, but by age 13 consider dividing your money up half and half in stock and bond funds. At age 16, you could follow the example used by T. Rowe Price in 529 college savings funds: Put only 34 percent into stocks, about 52 percent in bonds, and 14 percent in a money market fund.

As your child begins college, have no more than 20 percent in stocks.

Are you saving for a house? Again, if you expect to need a down payment within about five years, insulate this money from the vagaries of the stock market. Down payments should be in money market funds, high yield savings accounts and CDs; not in stocks or stock funds.

To find the best rates for savings and CDs, go to www.bankrate.com.

Are you retired? When you are retired, and not earning any money, you probably cannot afford to lose money.

That's why conservative financial planners often keep only about 20 percent of a retiree's money in the stock market once they are in their 70s. Others might divide money up more like 50:50 in stocks and bonds, but make sure retirees have five years of living expenses in cash (money market mutual funds, high yield savings accounts, or CDs) so they don't have to sell stocks when it's a bad time to sell.

Afterall, think of retirees, who had technology stocks during the last downturn in 2000-2002. Even solid stocks have not regained their 2000 highs. Some dropped more than 50 percent. If retirees needed money for property taxes or a car repair, and had to sell those stocks at their worst point, they cemented their losses and left no opportunity to recover.

Are you saving for retirement? If you are many years from retirement, you will recover from this downturn in time. Cycles are painful, but natural, in the stock market.

Throughout history it has been rare for the stock market to remain down for more than five years. It has never happened for 15 years. So if you are years away from retiring, you are likely to enjoy the surge in the stock market that eventually comes after every bear market.

Although stocks do drop more than 20 percent during bear markets, the good times have carried the stocks higher. If you had invested $1 in the stock market in 1926, you would have gone through the Great Depression, and several bear markets, and have about $2,700 today. In the safer alternative -- bonds -- you would have about $70.

Combine stocks and bonds to make money safer When you combine stocks and bonds you give your money a chance to recover from bear markets, and you also insulate it somewhat during the worst periods. Think of bonds as shock absorbers.

Research by Ibbotson Associates of Chicago makes it clear. If you had 100 percent of your money in stocks, you would have lost 12.4 percent a year on average during the worst five years in stock market history. But with 70 percent in stocks and 30 percent in bonds, you would have lost just 6.3 percent a year. If you divided your investments 50:50, the loss would be just 2.7 percent.

Financial planners often suggest that people in their 30s and 40s select a 70:30 combination. On the verge of retirement, they might go to 50:50.

Don't rely on last year's winners If you looked at your investments last year, you might think you are still in winners.

Then, small cap stock funds and emerging market stock funds were soaring. That's not true now. Small caps, or small companies, are vulnerable at times like this. While large companies can cut fat to weather recessions, smaller companies can't.

So don't dump all your small caps, but make sure you aren't holding a super-sized portion. Also make sure you didn't load up on emerging market funds. Instead, count on a diversified international fund to give you some exposure to developing areas of the world, but not an overdose.

Consider the moderate approach Here's an example of how you might divide your money up in a moderate portfolio of mutual funds if you can convince yourself to stick with stocks for the long term, but are afraid to be too exposed now.