The P/E ratio is used probably as the most common ratio to value a business because it is easy and quick. Roughly speaking, buying the P/E of 10 means that it takes 10 years for the company to pay back your investment, provided that its annual earning remains the same during that period. Many professional investment analysts like to compare it for one firm with that of others in the same industry.
As far as I am concerned, however, it can be only used as a crude yard stick that may give you a hint that the company is selling relatively cheap or expensive. Without further research, such figures can be misleading.
One reason is that quality of earning is not the same from company to company. For some, much of what they earn must be reinvested back to the business to sustain their competitive position in the industry. For others, only a little amount is needed. The main culprit is capital expenditure. Many capital-intense companies on average should spend a lot more as capital expenditure than what they depreciate on the book. This makes the quality of their earnings go down by the difference. If you buy, say, an oil drilling company just because its P/E ratio is low, it may be a mistake.
In addition, the earning should be durable and should come from its main business operation. If the earning comes from one-time profit or accounting gimmicks (for example by adjusting inventory, predicting bad debts, forecasting unusual gains or losses improperly, etc), it is not the true earning. Thus, it should not be used as a measure of valuation.
Lastly, you should also keep in mind the future growth of the earning. If there is enough room for the earning to grow in the near future, a high P/E ratio may be justified. However, you should watch out for a high P/E company only with rosy prospects and without fundamentals.
With the frequent and easy use of database, it has become increasingly hard to find undervalued companies just by plugging in such ratios as P/E and B/M in a computer. Based on my experience, many great buys appeared where P/E ratio looked very expensive. For example, a company with excellent underlying economy may experience a temporary difficulty in generating the earning, which results in the very high P/E temporarily.