Value investing is one of the most successful moneymaking strategies in the market. Master investor Warren Buffett, for example, has earned greater-than-20% annualized returns for the past 40 years by buying good companies when they're cheap.

Unfortunately, companies often get cheap for a reason: Something may be wrong with them.

The ugly
One of Buffett's best investments was a major stake in Coca-Cola (NYSE:KO) in the fall of 1988 -- in the aftermath of 1987's Black Monday crash, when most analysts thought Coke's growth prospects were dim.

Since 1988, Buffett's investment in Coke has earned impressive 16% annualized returns. But the company struggled along the way -- in recent years analysts began doubting the brand's power and growth prospects. Yet since November 2005, you could have bought Coke and earned 47% returns in just two years' time!

Motley Fool Inside Value lead analyst Philip Durell was among the few who didn't think the market could keep such a great company down for long. He recommended the company to subscribers in the January 2005 issue, for many of the same reasons Buffett bought it in 1988. Coke's situation was just ugly enough to get you a great price on a good company.

The same could also be said for the public relations difficulties facing Wal-Mart (NYSE:WMT), the credit-crunch fears that have waylaid retail bank behemoth Bank of America (NYSE:BAC), or the energy-price volatility that kept battering stocks like Chesapeake Energy (NYSE:CHK), Nabors Industries (NYSE:NBR), and Petrohawk Energy  (NYSE:HK).

But as we've seen with energy companies, good businesses will become very good investments. Coke never had legal troubles, and CEO Neville Isdell was focused on growth drivers such as emerging markets. There was a clear case to be made for good returns -- and eventually, the market came around.

When ugly is too ugly
But it can get really ugly in the market. Master small-cap investor David Nierenberg told Fool co-founder Tom Gardner that there are two signals that can help you steer clear of an ugly situation. First: "If we see an ethical blemish on the part of the incumbent management or the board, we are absolutely not interested. The second is: If we cannot trust or understand their accounting, we are absolutely not interested."

Krispy Kreme Doughnuts is one stock Nierenberg was avoiding when Tom interviewed him in 2005. Although new management was trying to turn the business around, the company had not yet released any new, reliable 10-Ks or 10-Qs. (It did so in April 2006.) As Nierenberg wondered to Tom before those releases: "[Has] this company ever earned a real profit? And what return on invested capital has it actually made at the newly opened stores?" Without answers to those questions, it was impossible to determine in 2005 at what price Krispy Kreme was a value -- if any.

A Fool's final word
When you're trolling for values in the market, you'll find some ugly situations. Without reliable management and financials, you should consider the situation too ugly for your dollars. With a financial stock like Bank of America in today's environment, it's worth assuming that additional write-offs are forthcoming ... if only to be conservative.

Separating the ugly from the too ugly is tricky. If you'd like some help, consider a 30-day free trial of Inside Value. Philip specializes in finding ugly situations that are ripe for profitable turnarounds -- whether it's because of new management, new strategies, or new events. Click here to learn more.

This article was originally published on Jan. 31, 2006. It has been updated.

Tim Hanson does not own shares of any company mentioned. Coca-Cola, Wal-Mart, and Chesapeake are Inside Value picks. Bank of America is an Income Investor recommendation. No Fool is too cool for disclosure.