Into each portfolio, a little down-market rain must fall. You don't need a very good memory to recall the anxiety investors felt just days ago, before Ben Bernanke and the Federal Reserve gave stocks an early Christmas present. Now that the all-clear has sounded, lots of people are convinced that the market has to go up strongly from here.

Yet if the ups and downs of the stock market are giving you indigestion, take heart. Over the long run, none of those bumps really matters. And historically, as long as you have enough time to wait out the bad patches, stocks have rewarded investors.

What matters
In the end, only two things matter with investing: the price you paid, and the price you get when you sell. As with any journey, the road your investments take in between may be interesting. But as long as you don't do anything rash and sell out early in response to those gut-wrenching drops, you won't change how much money you have when you cash out.

Now, don't get me wrong. That doesn't mean you can ignore your individual investments along the way. When it becomes clear that a company's journey is headed toward trouble, you have to part ways. Staying aware of those early warning signs is the only way investors got out of stocks such as Enron and WorldCom before they could do too much damage.

But until those trouble spots appear, doing nothing with your investments is often the best move. And even when a company goes through hard times, that doesn't mean you should get rid of it right away. Often, companies work through those trouble spots, and it turns out to have been the perfect time to buy. Picking up DaimlerChrysler (NYSE:DAI) or Citigroup (NYSE:C) right before their respective bailouts provided huge rewards. And facing down tobacco lawsuits by buying Altria (NYSE:MO) at its lows gave investors multibagger results.

Time heals all wounds
When you're looking at the market every day, the rising and falling overwhelms any notion of stability. Daily moves of 1% or more are common for the overall market, with even larger fluctuations in the prices of many individual stocks.

If you step back, however, and look at the market from a longer-term perspective, those hills and valleys smooth out into a much more continuous curve. As this month's issue of Rule Your Retirement highlights, history shows that the longer the period in which you have to invest, the more likely your investments will be successful. Since 1926, in the worst year stocks fell more than 43%. Even over a five-year period, you might have had to suffer losses averaging 12.5% each year.

But over 20-year periods, stocks have always made money. The worst period still had investors making more than 3% per year. And while the road was bumpy getting there, those who had the tenacity to see it through fared reasonably well at the end.

Hope for the best
Those numbers may help you prepare for the worst that the stock market can dish out. Whenever markets are near their highs, it's useful to look at worst-case scenarios.

But it's much more likely that things won't be quite that bad -- and if that proves to be the case, then you can hope to earn quite a bit more than 3%. With living expenses and other retirement costs on the rise, you'll need every penny you can get. Stocks can help you get there.

So when the market takes a lurch downward, don't let your mood fall with it. In the long run, things will work out -- as long as you have a good investing plan and stick to it.

Related articles:

See everything Rule Your Retirement has to say about preparing for a successful retirement, and see it all for free with a 30-day trial. Every month, Foolish retirement guru Robert Brokamp and his team of experts look at a wide range of retirement topics. Let Rule Your Retirement help you start to plan for your retirement today.

Fool contributor Dan Caplinger gives himself pep talks about stocks from time to time. He owns shares of Altria. The Fool's disclosure policy always gets there in the end.