Source: Wikimedia Commons

One of the hottest stocks to own over the past year has been Rite Aid (RAD -31.13%), the third-largest stand-alone drugstore chain in the United States. Even after it saw its shares tumble 7% on June 5, the company's stock is still trading 195% above its 52-week low, so needless to say the company has come a long way. While optimism is good, it's imperative to understand the strengths of the business that justify its valuation and, possibly, further share price appreciation.

Rite Aid's margin expansion is nothing short of miraculous
The past five years have been interesting for Rite Aid. At a time when Walgreen (WBA 0.57%) and CVS Caremark (CVS -0.22%) have seen their sales jump 14% from $63.3 billion to $72.2 billion and 29% from $98.1 billion to $126.8 billion, respectively, Rite Aid's sales have declined. Between 2009 and 2013 (the retailer's 2010-2014 fiscal years), its revenue dropped 0.6% from $25.7 billion to $25.5 billion.

RAD Revenue (Annual) Chart

RAD Revenue (Annual) data by YCharts

Although this is bad on both an absolute basis and relative to its peers, the company's bottom line has increased from a net loss of $506.7 million to a gain of $249.4 million during this period. According to Rite Aid's annual reports, the main driver behind this bottom-line improvement has been its cost of goods sold, which has fallen from 73.4% of sales to 71.3%. Other factors were also in play, such as lower interest expense and reduced lease termination and impairment charges, but its cost of goods sold was, by far, the single biggest area of improvement.

Over this five-year time-frame, Rite Aid's rivals have had mixed results in the area of cost control. Between 2009 and 2013, Walgreen, like Rite Aid, saw its cost of goods decline, from 72.2% of sales to 70.8%. CVS, on the other hand, saw its costs climb from 79.3% of sales to 81.2%. In relation to sales, the spread between each business shows that Rite Aid has been the most successful in improving its cost structure, as can be seen in the table below:

COGS/Revenue 2013 2012 2011 2010 2009 Improvement
Rite Aid 71.3% 71.2% 74% 73.5% 73.4% +2.1%
CVS Caremark 81.2% 81.7% 80.8% 78.9% 79.3% -1.9%
Walgreen 70.8% 71.6% 71.6% 71.9% 72.2% +1.4%

Source: Yahoo! Finance

According to Rite Aid's financial statements, the biggest driver behind this improvement was a LIFO credit of $147.9 million in 2012 vs. a $188.7 million charge a year earlier. Because of the way it accounts for its inventory, Rite Aid sees the cost of its goods decline in a deflationary environment. Foolish investors need to take this into account when valuing the earnings of Rite Aid, or any other company. 

While the U.S. has not seen deflation taking place, the drug business has because of the introduction of more generic drugs relative to their brand-name counterparts. Since generic drugs don't require the same kind of development costs that brand-name drugs do, they carry lower price points but higher margins.

Everything's easier when you have help!
In addition to seeing higher margins, Rite Aid has also benefited from partnerships like the one it has with GNC Holdings (GNC). This long-standing relationship, which began in 1998 and continues to be expanded by both businesses every year, has done wonders for Rite Aid. According to the terms of their agreement, Rite Aid must add GNC mini-stores (aka store-within-a-store locations) inside some of its retail locations each year.

Source: GNC 

Even as Rite Aid's store count has dropped by 4% over the past five years from 4,780 locations in 2010 to 4,587 in 2014, the proportion of GNC store-within-a-store locations in Rite Aid stores has risen from 40% of stores to 48%. Although Rite Aid does not disclose its GNC revenue and margins separately, GNC does provide these metrics for the business' cumulative third-party activities.

In 2014, GNC reported that its revenue from its relationship with Rite Aid came out to about $78 million, with operating margin coming in at 40%. When you consider that this margin is higher than GNC's aggregate operating margin of 17.5% and Rite Aid's of 2.8%, it's safe to assume that Rite Aid is seeing some benefits from the deal as well. This implies that as the company's ties with its strategic partners grow, so too will the benefits it receives from them.

Focusing on the things that count
Another big change for Rite Aid in recent years has been its focus on cultivating its more profitable stores while shuttering those that fail to create shareholder value. This can be seen by the fact that a 4% reduction in store count resulted in the modest drop in sales the retailer experienced.

Over the past five years, Rite Aid's stores have remained around 10,000 selling square feet, or SSF, apiece.  During this period, the stores in the Eastern portion have risen from an average of 8,800 SSF to 8,900 SSF, while its Western stores fell from 15,400 SSF to 14,900 SSF.  What this implies is that management is trying to find a nice midpoint between size and efficiency in these regions so it can optimize revenue per square foot (and margins).  

Average Store Size (Sq. Ft.) 2013 2012 2011 2010 2009
Rite Aid 10,000 10,000 10,000 10,000 10,000
Eastern Rite Aid Stores 8,900 8,900 8,900 8,800 8,800
Western Rite Aid Stores 14,900 15,100 15,100 15,200 15,400
CVS Caremark 9,791 9,802 9,758 9,705 9,651
Walgreen 10,371 10,376 10,475 10,440 10,539

Sources: Rite Aid, CVS, and Walgreen

Interestingly, Rite Aid's stores are, on average, smack in the middle of the range used by both CVS and Walgreen of around 9,800 SSF to 10,400 SSF each, respectively.  Like Rite Aid, both of these peers have also been changing their store sizes, with average selling square feet increasing at CVS and dropping at Walgreen. This suggests that Rite Aid's physical locations might be, on average, just the right size for optimal revenue.

Foolish takeaway
Despite the problems that have faced Rite Aid in the past, as well as the challenges that await the business in the future, it has a number of strengths that could help it achieve prosperity. Moving forward, it's uncertain whether or not these advantages will be enough when you consider the competition from Walgreen and CVS, but if management can continue to utilize its resources like it has in these past few years, it's likely that the company's shares could make for an interesting prospect for the Foolish investor.