After several years of struggles, Rite Aid has demonstrated solid performance in recent quarters and has plans to stay competitive with rivals CVS and Walgreens.

Rite Aid (NYSE:RAD) has been a turnaround story in the eyes of Wall Street over the past several years. A combination of operational issues following the acquisition of Eckerd Stores in 2007 and strong competition from Walgreens (NASDAQ:WBA) and CVS Caremark (NYSE:CVS) plunged Rite Aid into a string of net losses that occurred as recently as the company's fiscal year ended March 2012.

Fortunately for Rite Aid, management has managed to turn the ship. Improved operating performance has allowed Rite Aid to acquire RediClinic and expand its NowClinic concept in the hopes of rolling out an in-store care competitor to CVS' MinuteClinic on a wide scale basis. Now that Rite Aid has regained its footing and has begun reporting sales growth and positive net income, should it be analyzed and valued similarly to Walgreens and CVS? There are several factors to consider.

Dramatic turnaroundThe return to profitability and reduction of debt have led to a dramatic recovery in share price over the past year:

With the stock nearly tripling in value over the past twelve months, it is clear that investors buy into management's plan and ability to execute. Today's share price is just under 20 times the midpoint of management's estimated fiscal year 2015 earnings.

Tough competitionTo assess the reasonableness of Rite Aid's current valuation, it is important to review the valuation relative to the competition now that the "turnaround story" is fading away and the focus on growth and competitive position moves back to the forefront. Here is a comparison of several widely used metrics:

RAD

WAG

CVS

TTM price to sales ratio

0.27

0.87

0.68

TTM price to earnings ratio

32.30

23.91

19.43

Forward earnings ratio

14.60

17.32

14.49

Source: Yahoo! Finance, April 30, 2014

This basic set of information highlights one of two key issues that remain for Rite Aid. With the lowest price to sales ratio and highest price to earnings ratio of the group, Rite Aid still has a serious margin issue. Rite Aid's operating margin of less than 3% is well below the 5% reported by Walgreens and 6% reported by CVS.

A second key issue stands out when looking at each pharmacy's balance sheet:

With a significantly more leveraged balance sheet (on a relative basis), Rite Aid's ability to invest in growth remains more limited than its larger peers even after reducing its net debt by $300 million over the past year.

It should no surprise that Rite Aid does not pay a dividend given its recent turnaround, lower margins, and higher relative debt load. In contrast, Walgreens and CVS pay dividends equivalent to 1.9% and 1.5%, respectively.

Is Rite Aid the best investment option?The turnaround at Rite Aid is largely complete and guidance for comparable store sales growth is just 2.5%-4.5% for the coming year. This means that the upside to investors resides in the belief that management can exceed guidance by improving margins to levels closer to the competition and successfully integrate and expand the RediClinic concept. There is of course risk that this improved performance will not materialize at the rate expected by the market; as noted above, the midpoint of management's guidance implies a price to earnings ratio of 20 rather than the ratio of 15 being priced into the stock by analysts with higher growth assumptions.

Rather than risk that Rite Aid fails to exceed its own guidance by enough to meet analyst expectations, there is a much safer route to strong investing results within this peer group: CVS Caremark. Both CVS and Rite Aid are trading at a forward earnings multiple of roughly 15, yet CVS has best-in-class margin, proven success and a leadership position with its MinuteClinic rollout, and a solid 1.5% dividend payout. With these positives and fewer risks to the valuation model, CVS remains a better choice for delivering solid returns among large pharmacies.