Q: Stocks that are growing rapidly often trade at extremely high P/E ratios. Is there a better way to compare these types of companies?

The price-to-earnings (P/E) ratio is perhaps the most commonly used metric to evaluate stocks, but it isn't always useful, especially in the cases of rapidly growing companies. For example, shares of Amazon.com cost roughly 240 times earnings as I write this, and Netflix trades for a P/E of 207, although I wouldn't necessarily call either stock expensive.

An alternative is the price-to-earnings-growth (PEG) ratio, which takes a company's growth rate into account. The math is simple enough: Divide the P/E ratio by the expected earnings growth rate going forward, which should be readily available on major financial websites.

For example, on a recent episode of The Motley Fool's Industry Focus podcast, I discussed comparing Visa (V -0.23%) and Mastercard (MA 0.07%) -- obviously two very similar companies, business-wise. Both trade for approximately 29 times their expected 2017 fiscal year earnings, which not only looks expensive at first glance, but it's exactly the same.

This is where the PEG ratio is useful. Visa is expected to grow its earnings at an annualized rate of 17% over the next five years, which translates to a PEG ratio of 1.7. On the other hand, MasterCard is expected to grow earnings at a 15.3% rate, which corresponds to a PEG ratio of about 1.9. Comparing the two shows that Visa might be more cheaply valued.

The PEG ratio, like any metric, is just one part of a thorough analysis of a stock. However, it can add some clarity to situations where the P/E ratio doesn't tell you much.