Amazon.com (Nasdaq: AMZN) was one of the most wildly hyped stocks during the late-90s Internet boom. Early in its history as a public company, Amazon clearly established that consumers like the convenience of buying books online -- sales soared in its early years as a public company. Amazon truly appeared to be revolutionizing the book business.

But there was one small problem -- the one thing that Amazon didn't generate during that time period was profits. It wasn't until 2002 that the company actually turned a full-year profit.

Investors who ignored the 1990s hype and focused solely on profitability were amply rewarded. Those who bought Amazon at the end of 2002 are now up more than +280%, equivalent to almost +28% annualized

And Amazon is by no means an isolated example. Back in 1995, Yahoo! (Nasdaq: YHOO) was a struggling dot-com startup with just $1.4 million in annual revenues. At that point in time, the vast majority of Americans were still unfamiliar with the Internet. Wall Street had yet to catch on to the company's long-term potential, and not surprisingly, the stock languished in the roughly $2-3 range (on a split-adjusted basis) throughout much of the mid-1990s.

Behind the scenes, however, Yahoo's management team was working hard to build the firm's presence in the booming online market. And as the firm's revenue base and the online advertising industry continued to grow in subsequent years, it eventually moved toward profitability. By the time 1998 rolled around, Yahoo had figured out a way to earn steady profits. Not surprisingly, investor interest in the company exploded and the firm's stock price followed suit, soaring over $120 (split adjusted) at the height of the dot-com craze in 2000.

More recently, Research In Motion (Nasdaq: RIMM) finally turned a profit in 2004 after three years of losses. If you had bought the stock on the day it announced its annual profit, you would now be up close to +700%, equivalent to a near +60% annualized gain.

Experienced investors won't find it hard to believe that this phenomenon is common. Wall Street has a tendency to ignore stocks that are losing money. At the same time, it's not usual for a young company with a limited business history to show a loss in its first few years of operations.

After all, young firms must spend big on advertising to establish their brands. And these firms often have to purchase equipment and buildings to run their business -- all these up-front costs cut into profitability in their early years of operation.

But companies that lose money aren't necessarily bad investments. Often, once these firms establish their business the earnings start flowing. And earnings growth invariably attracts investors, sending the stock sharply higher.