No matter how you stack it, there's no denying that shares of Rite Aid (RAD 15.79%) have moved RADically higher this year. If you don't believe me, check out this graph below of the company's year-to-date share price appreciation:

High rise for this small player
Starting the year off at $1.40 per share, the company has since risen to $5.19 per share, making for a 270.7% gain year to date. This meteoric rise can be attributed to the company posting its first yearly profit since its 2007 fiscal year due to lower costs, slightly higher revenues following its 2013 fiscal year end, and higher margins from a larger mix of generic drugs. The market has seen this news as being so positive that the company has blown away its peers in terms of stock price appreciation. This can be seen in the graph below:

This graph measures the year-to-date performance of Rite Aid, CVS Caremark (CVS 0.82%), and Walgreen Company (WBA -0.48%). We can see that each company has performed well, but that that Rite Aid appears to have left the competition in the dust.

So why is this? Here we have a company that, with a market capitalization of $4.75 billion, has performed terribly until recently. For instance, the company currently has about $6 billion in debt and a negative book value of more than $2.3 billion, which equates to -$2.53 per share (an almost yearly decrease from -$1.35 per share in 2009.) On top of this, Rite Aid's revenue has remained relatively flat over the past few years. The only positive development has been a narrowing in losses and, subsequently, a small switch to profitability as its net income rose to $118.1 million. In essence, any price appreciation as been attributable to the company's gradually improving profitability.  

Competitors' edge
With this established, we should ask ourselves what the endgame is for investors willing to take a stake in this apparent turnaround.  Based on the change that is taking place across the industry in which companies are focusing more on the sale of generic drugs and developing in-store clinics, it seems that the company will likely be able to continue its improved earnings.

Rite Aid has a lot of catching up to do, however. While it had net sales of $25.39 billion in its last fiscal year, Walgreen's revenue was $71.63 billion and CVS's revenue was $123.13 billion.  

It should also be mentioned that, in addition to having a sales curve to climb, each comparable has significantly better margins than Rite Aid. As an example, Walgreen's has a four-year average net profit margin of 3.3%. Meanwhile, while CVS has posted a slightly higher average of 3.4%. 

Just because this is a steep hill to climb from the company's four-year average of -1.3% and current net profit margin of 0.5% doesn't mean that investors should despair, however. Rather, it would be prudent to not dwell so much on the past and instead see what effect its likely continued improvement could have on the company. This, in turn, provides a glimpse of the kind of value that can be realized for those interested in buying today.

Foolish takeaway
No matter what you elect to do with shares of Rite Aid, remember that all estimates of future value are based on speculative assumptions derived from looking at comparable companies. Additionally, no matter what an investor does, the Foolish investor would do well to consider the fact that a company that has underperformed in the past will likely continue to underperform in the future. If Rite Aid can rise up to the same level of profitability as its peers, however, then its investors will likely be well rewarded.