Mr. Market is not a happy camper right now. But for investors looking for great long-term investments, the news couldn't be better.

The current uncertainty about a host of economic factors, including the credit crunch and the housing downturn, has the markets acting irrationally. Just as value investors have long personified the market as a single individual, Mr. Market, you can also create his archrival, Mr. Uncertainty. Like Superman to kryptonite, Mr. Uncertainty wreaks havoc on Mr. Market during every encounter.

You might think that Mr. Uncertainty would be your worst enemy, too. But actually, uncertainty is an investor's best friend.

Finding bargains
The stock market loves information. Stock analysts, for example, let the market peer into the future and make rational judgments about where stock prices are headed. But unfortunately for investors, when the market is rational, it tends to price shares at higher levels.

On the other hand, uncertainty distorts the market's pretty little picture of the world. Unable to predict what lies ahead, the market starts systematically punishing any and all businesses that don't meet its expectations. If a company says it'll earn $0.50 next quarter, it had better deliver the goods. Give Mr. Market $0.49 and that penny will cost you dearly.

Patient investors should view these uncertain times with great anticipation for impressive future results. When the markets are so irrational that stock prices become distorted from business value, that can present a once-in-a-lifetime opportunity to value investors.

Reality versus uncertainty
The fact is that reality is never certain. Thoughtful investors, before rushing for the exits when a company announces bad news, should ask themselves if this type of market reaction makes any sense. If the company has a good business with favorable long-term fundamentals, then investors should use these wild swings to acquire assets that may now be undervalued.

As an example, consider what happened to Ameron International (NYSE: AMN) last week. Ameron is a wonderful little business that operates in the industrial, transportation, and infrastructure markets. Its products include the likes of oil pipes, water transmission lines, and steel products. When I looked at the company last year, it looked like a smaller niche version of Cemex (NYSE: CX) or Vulcan Materials (NYSE: VMC), with international exposure, solid fundamentals, and room to grow.

Last week, the company reported that quarterly net income and sales increased 15% and 24%, respectively. In response, the shares dived 20%. Why? Apparently Mr. Market was looking for more.

Yet Ameron, unlike most high-growth businesses, was trading at a reasonable valuation initially. Before the announcement, the price-to-earnings ratio was in the 14-15 range, no net debt, net margins of more than 10% and a return on equity of more than 15%. Unlike higher-multiple stocks like Google (Nasdaq: GOOG) or Yahoo! (Nasdaq: YHOO), this company didn't seem this vulnerable to a missed estimate.

Bumpy ride now, smooth sailing later
Today's market is littered with similar examples of Mr. Market's overreactions. A business experiences a temporary decline in profitability and it's treated as if it were slowly headed toward bankruptcy.

Uncertainty creates the irrationality that leads the market to be inefficient. If you identify strong businesses that have been targeted by uncertainty, you might have a bumpy ride for the next few months or quarters. But years from now, you'll be glad you invested when the bargains were there.

Related Foolishness:

Learn more about the best values in the markets today and how to profit from uncertainty -- it's free with a 30-day trial subscription to Motley Fool Inside Value.

Fool contributor Sham Gad is managing partner of Gad Partners Funds. He has no stakes in the companies mentioned. Yahoo! and Cemex are Stock Advisor recommendations. The Motley Fool owns shares of Cemex, which is also a Global Gains pick. There's no uncertainty about the Fool's disclosure policy.