When you lose money on an investment, it's natural to start wondering whether the pundits are right when they say investing has much in common with gambling. After all, there's a good deal of uncertainty in investing; there are absolutely no guarantees that any particular investment will make money.

It can be frustrating putting money into a stock like KrispyKreme Doughnuts (NYSE:KKD), a company with a long history in many communities, a very strong regional brand, and a visionary growth and expansion plan, only to see that expansion fall flat on its face due in part to the resulting overcapacity and excessive costs. Krispy Kreme's overly aggressive expansion plans have led to problems that have nearly destroyed the company, and its current shareholders are sitting on a company worth less per split-adjusted share than it was at the time of its IPO in 2000. Likewise, it can be painful seeing a market leader like microprocessor and semiconductor powerhouse Intel (NASDAQ:INTC) struggle in the marketplace. As dominant and solid as Intel continues to be, its shares still command less than half the value they did five years ago.

As an investor, if you're looking at pages and pages of red ink on your brokerage statement, despite owning well-known brands like Intel and Krispy Kreme, you might very well think of the stock market as a casino, with the chips stacked against you and your eventual financial well-being. And with a situation like that, you might think that it makes more sense to cash in your chips and go home, rather than continue to fork over your hard-earned money to a system that looks so stacked against you.

You're in good company
If so, you're not alone. The father of value investing, Benjamin Graham, likened the stock market to a roulette table -- a game of chance where the house has a built-in advantage. The difference, though, is that Graham's strategy stacked the odds in his favor. While nobody can guarantee a house win with every spin of the wheel, that built-in house advantage means that over time, the casino will rake in cash at the roulette wheel. Likewise, Graham's proteges know there are no certainties in the market, but there are ways to help assure that, over time, the value investor will have the advantage and come out ahead.

Graham's lessons are simple, yet powerful, and generations of investors have made money over the long haul by following in his footsteps. It takes time to build wealth, though, and anyone who tells you otherwise is likely trying to speed the process along for him or herself, by confiscating your hard-earned cash. Ever wonder why state lotteries and casinos like Harrah's (NYSE:HET) and MGM Mirage (NYSE:MGM) are such cash generators, despite the fact that most rational folks know the odds are not in their favor when gambling? It's not just due to the entertainment value. It's because they offer the hope of striking it rich and doing it rapidly. If you can shed that irrational urge, you can build substantial wealth over time as a value investor.

The master's lessons
As I said before, Graham's lessons are simple, yet powerful. His key teachings can be summed up in just a few key points:

  • Determine what a company is really worth and buy only if its stock is trading safely below that value
  • Look for solid, sustainable dividend payouts as a sign of financial strength
  • Diversify appropriately since not every investment will work out
  • And above all, after buying, be patient and wait for the stock to rise once others recognize the stock's worth

By following these simple rules, it is quite possible to beat the market. My friend and colleague Philip Durell, a long time follower of Graham, is proof of that. His Motley Fool Inside Value newsletter has more than doubled the market's return since its inception last year. His selections as a whole have performed so strongly, in fact, that I'm going to do something radical: I'm going to name his two worst performers. Fannie Mae (NYSE:FNM) and Doral Financial (NYSE:DRL) are both mortgage financier that have run afoul of accounting rules, and both have fallen about 15% since Philip recommended them. Both prove the value of Graham's lessons.

Learning from losses
First and foremost, both companies have illustrated the value of knowing what a company is truly worth and having the patience to wait for the market to recognize that value. To be sure, Doral has been especially tricky, having announced after Philip's recommendation that it would have to restate past financial results. Fannie Mae faces the prospect of increased U.S. government regulation that could curtail its business. Investors have panicked as a result.

But if you follow Graham's wisdom, you'll see that you should stick to your guns. You'll know what these companies are worth and you'll be willing to buy even as others panic. The share prices of both Fannie Mae and Doral already reflect the companies' troubles. They're cheap. You just need to have the patience to wait through the volatility.

Additionally, both Fannie Mae and Doral show how important diversification is. It's no coincidence that both firms are mortgage financiers that got tripped up by derivative accounting. Derivatives are complicated financial instruments. Companies in similar lines of work tend to look over one another's shoulders, and when one seems to be getting away with aggressively interpreting the rules a bit, the pressure grows substantially for others to follow. While both companies are expected to emerge from their scandals relatively unscathed, the short-term gyrations from such troubles can be painful. To minimize that pain, the best medicine is to spread your investments out -- to not concentrate too much in one company or specific industry.

Powerful profits over time
As of this writing, and despite losses by Doral and Fannie Mae, Philip's Inside Value picks are trouncing the market, gaining 13.6% vs. the S&P 500's 5.3% return. In an industry where more than 90% of mutual fund managers cannot sustainably beat passive index trackers like the Spiders (AMEX:SPY), that performance stands out as truly remarkable. As Benjamin Graham pointed out more than half a century ago and Philip Durell is demonstrating today, you as an investor cannot guarantee the profitability of any given investment. By following the value investing rules, however, you can certainly stack the odds in your favor and better assure your success over time.

Like the idea of treating investing as though you're playing with the house's odds, rather than a gambler's? Click here for a 30-day free trial to Inside Value, and join other like-minded value investors as they seek out superior long-run investment returns. In the next issue, due out in August, Philip will tell you which of the past year's recommendations are most attractively priced now.

Take a trial today and enter our "A Stock I'd Love to Own" contest, where the winner and runners-up will walk away free subscriptions. To enter, all you need to do is tell us about you favorite money-making machine. Intrigued? Click here to take your trial and find out more.

At the time of publication, Fool contributor and Inside Value team memberChuck Salettaowned shares in Doral Financial. He didn't have a financial position in any other company mentioned. Krispy Kreme is a recommendation of Motley Fool Stock Advisor.The Fool has a disclosure policy.