After three years of being chewed up by a raging bear market, investors have watched the broader market spike 25% in just two short months. The gains came so fast and so furious that many investors missed their opportunity to buy, waiting for a pullback that never came, waiting to buy shares at a price they'd never hit.

While hindsight is 20/20, the lessons that can be learned from the missed opportunity reinforce elemental truisms of stock market investing, namely, that markets are impossible to time; staying in the stock market can reap rewards; and waiting to take action rarely works.

In retrospect, the rally off the March lows seems obvious. Valuations were reasonable, uncertainty around the war in Iraq was fading, interest rates were low, profits were showing slight improvement, and after three years, the market seemed oversold. And yet, many investors who spent years waiting to get back into the market avoided stocks.

Blame fear of failing. "Two years of a bear market makes for a lot of hesitation, but investors shouldn't have," said Dave Williams, manager of the Excelsior Value and Restructuring Fund. "A lot of professionals missed it, too. They're under the pressure of clients not wanting to lose any more money. There's a lot of safety in cash."

With money parked in cash, experts say investors' fear left many paralyzed, unwilling to buy rising shares, waiting to buy stocks when they slid again, only to have buys thwarted by another day of gains. As more and more bulls joined the parade, the momentum changed the market tone dramatically, but the skittish stayed sidelined, unwilling to buy the Dow at 8600, and even less willing when it hit 9000.

Investors behaved in the exact opposite way they did in 1999, when many refused to sell for fear stocks would rebound. Missing such a golden opportunity after waiting so long is heartbreaking, but experts say investors behaved how the last three years have trained them to behave.

"It was sensible for many people. They had tried to take advantage of earlier rallies, which had not proved durable, and they subsequently got burned," said Ken Tower, chief market strategist at CyberTrader.

Ultimately, this serves as a reminder that it pays to stay in stocks, even when times are bad, because on a long enough timeline, equities have always gone up. While not reflective of recent history, a 1994 study from Aronson & Fogler, an investment management firm, provides a compelling illustration of how buy-and-hold investors tend to outperform market-timers.

Over a 24-year span from May 26, 1970, through Feb. 28, 1994, Aronson & Fogler's research showed that investors who started off with $1,000 in the S&P 500 would have ended up with $6,372, excluding dividends. But if that same investor had missed 20 of the best days in the 6,000 trading days over that 24-year span, he or she would have walked away with just $2,838.

It pays to stay invested in stocks, but getting back in seems trickier. After a 25% upside move in such a short span of time, the standard logic employed by many investors is to wait for shares to pull back and then buy. But this strategy hasn't worked over the last couple months and is fatally flawed because it can discount the effect that momentum has on a rising market, and create even more missed opportunities.

"It's very difficult for people to buy stocks that are already going up. It goes against the grain somehow, and yet, it's a very important part of investing," said Tower. "Think of any stock that goes up for an extended period of time, stocks that are market leaders, that go up for a year, or two years, or three years -- their charts are made up of a series of higher highs."

Tower used eBay's ( EBAY) recent run to illustrate how an upward trend can be more powerful than investor doubt.

"In late October, eBay was in the mid-$60s, hitting a new high, and many people came out and said this stock was too high, it's overvalued, they're not buying it here. And it was a mystery to them why anyone would buy it there," said Tower. "Well, the stock is at $100 now."

But as the second-quarter earnings preannouncement season approaches, many market-watchers expect stocks to retrench as headlines fill up with corporate profit warnings. Instead of waiting for a pullback, or trying to time the market, experts say keeping a long-term investment horizon and being choosy will help you make up for lost opportunities. After all, in 1999 when Internet stocks were all the rage, housing stocks were being overlooked.

"Pick your spots. There will be a pullback at some point, but rather than look at the market, look at individual stocks," Williams said. "Some stocks are still not where they should be. Not all stocks have been overdone here. I really invest for two and three years away. Will we pull back next month? Next week? Who knows? The market will be higher in one or two years, though."

If you liked this article you might like

Check the Math on Air Fares

Check the Math on Air Fares

US Airways Circles as Pilots Bicker

US Airways Circles as Pilots Bicker

Departure of Delta's Song Unit Boss Stirs Questions

Departure of Delta's Song Unit Boss Stirs Questions

Boeing Boosts Jet Deliveries

Boeing Boosts Jet Deliveries

CEO Gilmartin Will Survive Recall

CEO Gilmartin Will Survive Recall