In the competitive retail pharmacy market, three of the biggest players -- Rite Aid, Walgreen, and CVS -- face off for market share. Is one a better buy than the other?

In 2011, razor thin margins drove Walgreen(NASDAQ:WBA) into a price standoff with drug supplier Express Scripts -- the second largest pharmacy benefits manager in the United States. In January 2012, Walgreen walked away from $5 billion in revenue because it believed Express Scripts wasn't paying it enough to fill customer prescriptions.

The two companies finally reached an agreement last year in July, but not before damage had been done as CVS Caremark(NYSE:CVS) and Rite Aid(NYSE:RAD) won away Walgreen's customers during the impasse. More than a year after settling the dispute, is Walgreen, CVS, or Rite Aid the better buy?

The stakes remain highThe three retailers account for more than a third of total prescription market share in the United States, and that market is growing. More than $276 billion worth of prescriptions were filled last year, and as baby boomers retire and live longer, the number of prescriptions filled will likely climb. Prescription growth is also set to benefit from job growth and rising insurance enrollment tied to government reform.

Walgreen has inked a deal with major drug distributor AmerisourceBergen this year, giving it profit-friendly pricing power and the chance to own 16% of the company. CVS acquired pharmacy benefit player Caremark in 2006 and, thanks to an aggressive roll-out of MinuteClinics, offers basic in-store health care in more than 700 stores. And, Rite Aid has made a substantial push to keep customers returning, offering discounts to its best customers through its Wellness+ rewards program.

The moves come even as the industry faces more competition. They're no longer just competing with each other and independent pharmacists. They're also battling mass merchandisers Wal-Mart and Target. Both of those firms have made substantial pharmacy investments as part of their push toward one-stop shopping. As a result, Wal-Mart has become the fourth-largest player in the industry, winning nearly $18 billion in prescription business last year.

Debating the earningsThe competitive industry and high costs tied to brick and mortar stores means operating margins remain thin at Walgreen, CVS, and Rite Aid. CVS is the most profitable company, boasting operating margins of 6.3%. Rite Aid, while weakest, has been improving steadily this past year. And, all three have seen the measure improve in recent quarters.

As a result, earnings per share have been steady over the past few years. Of the three, CVS has an edge with earnings per share near multi-year highs. Rite Aid is riskiest, with the company only recently returning to profitability.

As Walgreen has wrestled to win back customers lost to CVS and Rite Aid last year, the company's ability to deliver on earnings has endured fits and starts. Over the past four quarters, Walgreen has beat analysts' forecasts twice, both times by a slim margin. As a result, analysts' earnings expectations for next year haven't changed much in the past quarter, with the Street estimating EPS of $3.94 versus $3.96 90 days ago.

CVS has done a better job at over delivering bottom line profit, beating analysts in each of the past four quarters. As a result, analysts have edged up next year estimates to $4.46 from $4.45 in the past three months.

But, the biggest surprise has come from Rite Aid. It has beaten forecasts handily this past year, producing unexpected profit in three of the past four quarters. That's given analysts the confidence to increase EPS estimates to $0.33 for next year from $0.25 90 days ago.

Debating valuationWhile the industry continues to grow, narrow margins and its competitive nature means you should be less willing to overpay for sales. That's why all three trade at price to sales ratios below 1.

If you're considering Walgreen, keep in mind you'll be paying more for every dollar of sales than at any other point during the past five years. Similarly, you're paying near the highs for CVS sales, too. And, while price to sales is just 0.19 at Rite Aid, you should keep in mind that the company has a spotty history of profitability.

Price to earnings ratios also suggest you should be more skeptical of Rite Aid than Walgreen and CVS.

All three companies boast P/E ratios in the mid-teens, with Rite Aid being most expensive at 17.7 times next-year estimates. Walgreen and CVS' forward P/Es are seemingly more attractive at 14.58 and 13.32, respectively.

However, Walgreen and CVS' ratios are roughly in the middle of their five year range. And, while Rite Aid's lack of historical earnings makes it harder to judge, it's likely that the company will eventually normalize at mid-teens P/E ratios over time.

Finally, P/E to expected growth suggests investors are paying comparatively less for CVS' expected earnings growth than for Walgreen and Rite Aid.

Fool's final takeMore than a year after Walgreen ended its dispute with Express Scripts, it appears both CVS and Rite-Aid have benefited more. While Walgreen is improving, its ability to beat expectations has been hit and miss, and shares appear fairly valued. CVS has done a much better job translating customers into sales, offering the best operating margins and track record for beating estimates. It's also most fairly valued, with lowest forward P/E ratio and PEG ratio. While Rite-Aid has seen a significant bump in margins and profits, the company appears speculative given an arguably rich valuation. This suggests that CVS may offer you the best risk/reward opportunity as retiring baby boomers and growing insurance enrollment drives prescription growth higher.

Todd Campbell has no position in any stocks mentioned. Todd owns E.B. Capital Markets, LLC, an institutional research firm serving portfolio managers. E.B. Capital's clients may or may not have positions in the companies mentioned. Todd also owns Gundalow Advisors, LLC, a high net worth advisory firm. Gundalow's clients do not have positions in the stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.

Author

Todd has been helping buy side portfolio managers as an independent researcher for over a decade. In 2003, Todd founded E.B. Capital Markets, LLC, a research firm providing action oriented ideas to professional investors. Todd has provided insight to a variety of publications, including SmartMoney, Barron's, and CNN/fn.
Follow @ebcapital