(This piece was adapted from a classic Fool article.)

Imagine you're looking at a newfangled invention called the "dollar machine." Once a year for 10 years, it spits out a brand-new dollar bill. How would you value this contraption? Obviously, a price tag higher than $10 is silly. Paying $9 might seem smart, as it locks in a $1 profit. But you can do better with your $9.

Think of it this way. (Warning: Math crossing next two miles.) If you invest $9 for 10 years and it turns into $10, you've achieved a total return of 11.1%. That might look good, but it's 11.1% over a 10-year period. It amounts to only about 1% per year. Jeepers -- even a passbook savings account might beat that, and it's insured, too. Investors should always consider where else they might plunk their greenbacks, and what other kinds of returns they might expect.

Back to our dollar machine. Let's say you expect a rate of return equal to the stock market's historic rate of about 11% growth per year. If so, you might decide to pay just $3.52 for the machine. That $3.52 invested for 10 years, earning 11% annually, becomes $10. If you expected to earn a 6% annual rate of return, you'd likely value the machine around $5.59. (You would probably be outbid by someone else, though... someone who realized that he or she could reinvest those dollars elsewhere at the end of each year.)

The dollar machine is not just a fantasy. It's very much like companies in which you buy stock. The price you'd pay for the machine is its "intrinsic value." Companies also have intrinsic, or fair, values that are based primarily on earnings, and investors need to keep this in mind when buying stock in them. Pay attention to a company's earnings and dividend payout.

If you bought a share of General Electric (NYSE:GE) in 1990, it would have cost you about $6. In the 10 years from 1990 to 2000, it paid out more than $6 in dividends. Was the $6 a good price, then? Well, considering that GE stock split 2-for-1 in 1994 and again in 1997, split 3-for-1 in 2000, and recently traded around $35 per share, you betcha. (Note, though, that GE shares are down considerably from their peak north of $55 back in 2000.)

Companies are valued on the profits they earn. When buying stock, you don't want to end up paying too much for a dollar machine.