Source: Rite Aid

July 3 was a great day for shareholders of Rite Aid (RAD). After reporting sales results for the month of June, shares of the country's third largest publicly traded drugstore chain shot up nearly 6% -- and that's on top of the massive gains that the stock has enjoyed over the past five years. Given these developments, and the fact that the company's stock is still trading 13% below its 52-week high, some investors are probably wondering what the future holds for this high-flying retailer. Can Rite Aid keep soaring, or will competition from Walgreen (WBA -5.57%) or CVS Caremark (CVS -6.15%) knock it back down?

Rite Aid's results were impressive
For the month of June, Rite Aid saw its revenue come in around $2 billion, which was 3.5% above the $1.93 billion that management reported for the same month last year. According to the company's press release, this performance came in spite of an almost 1% decline in store count from 4,612 locations to 4,574 and was the result of a 3.9% jump in same-store sales.

(billions) Jun. 2014 Jun. 2013 Sales Growth
Rite Aid's Revenue $1.995 $1.927 3.53%

Source: Rite Aid

The biggest contributor to Rite Aid's success was its pharmacy operations. For the month, the retailer saw its pharmacy comparable-store sales rise 5.4% compared to last June. This can largely be attributed to a 3.5% increase in prescription count, the effect of which was somewhat offset by the lower revenue coming from a greater number of generic introductions. Front-end comparable-store sales growth of 0.9% also helped Rite Aid as well, but nowhere near as much as its pharmacy results.

Can Rite Aid stand the heat?
One of the biggest problems with Rite Aid currently is the fact that the company's performance in recent years has been somewhat of a letdown. Between 2009 and 2013, the business's sales fell 0.6% from $25.7 billion to $25.5 billion as management closed nearly 4% of the retailer's underperforming stores.

This stands in contrast to the 14% sales jump of Walgreen and the 29% improvement seen by CVS. In spite of its relatively poor top line performance, though, the cost savings that the company's seen from shuttering its stores and the introduction of more generic drugs has resulted in its net loss of $506.7 million turning into a gain of $249.4 million.

(billions) 2012 Sales 2017 Low Est. 2017 High Est.
Worldwide Generic $260.6 $421.2 $432
U.S. Generic + Brand $328.2 $350 $380

Source: IMS

In particular, the growth of the generic drug market should prove very beneficial for Rite Aid. Although the lower price points of generic drugs results in lower sales, their lower production cost creates higher margins for retailers like Rite Aid and its peers. In a study released by IMS Health Thought Leadership in September 2013, it was forecasted that the appeal of generic alternatives will result in generic sales rising by between 62% and 66% to $421.2 billion to $432 billion, respectively, by the end of 2017 compared to the $260.6 billion recorded in 2012.

For Walgreen and CVS, which posted net profit margins of 3.4% and 3.6% in 2013, this development will be especially good. Given that CVS has 65 locations abroad, up from 18 in 2012, the retailer has some excellent opportunities in generics, particularly given that, if IMS is correct, a large percentage of the growth in generic sales will occur outside the U.S.

Source: Rite Aid

Walgreen should benefit even more from this favorable trend. With 119 locations outside of the United States and a 45% stake in Alliance Boots (and a potential acquisition of the rest of the company next year), Walgreen may benefit the most from generic drug growth moving forward.

Now, this isn't to say that Rite Aid won't see some benefits. With generic introductions expected to reduce brand spending in the U.S. by 34% over this timeframe but with total drug spending expected to grow from $328.2 billion to between $350 billion and $380 billion, the company will benefit from higher margins and sales as well. However, because Rite Aid does not have a presence outside of the U.S., it may not have the sales growth opportunities that Walgreen and Rite Aid enjoy.

Foolish takeaway
Right now, sales at Rite Aid appear to be doing very well. In the long run, it's likely that management will see this trend continue because of the growth forecasted in the drug market. Furthermore, an increase in generic introductions should send profits rising to some extent. Neither of these metrics will likely be able to keep up with Walgreen or CVS, however, because of the size and international exposure of those rivals. What this means is that while Rite Aid could provide the Foolish investor with some attractive prospects, Walgreen and CVS look to be better positioned for the industry changes that lie ahead.