Source: CVS. 

Even though the company missed analysts' earnings-per-share forecasts, shares of CVS Caremark (NYSE:CVS) inched up 1% to close at $73.86 after it reported a positive revenue surprise. In spite of management's inability to generate the profits that Mr. Market wanted to see, does CVS make for a sensible long-term investment or would Rite Aid (NYSE:RAD) or Walgreen (NASDAQ:WBA) be more attractive opportunities?

CVS' mixed quarter may have some investors concerned
For the quarter, CVS reported revenue of $32.69 billion. On top of beating the $32.31 billion that investors had anticipated, the company reported revenue that was 6% higher than its year-ago figure of $30.76 billion. In its release, CVS attributed the rise in sales to a combination of increased store count and higher comparable-store sales.

During the quarter, comparable-store sales climbed 1.4%. This increase stemmed from a 3.8% jump in pharmacy comparable-store sales but it was negatively affected by a 3.8% decline in front-end comparable-store sales as severe winter weather and a milder flu season hurt the business's performance. As of the end of the quarter, the company operated 7,675 stores, up almost 2% from the 7,531 locations in operation during the first quarter of 2013.

Source: CVS.

From a profitability perspective, CVS' performance wasn't so hot. For the quarter, the company reported earnings per share of $0.95, 9% below the $1.04 that analysts had anticipated. Even though this was a pretty large miss, the business did succeed in beating the $0.77 per share it earned in the same quarter of last year.

In its earnings release, the company attributed the rise in earnings to its higher revenue but also chalked it up to its operating expenses falling from 12.6% of sales to 12%. Another contributor appeared to be CVS' share count, which declined 4% from the year-ago period.

How does CVS look in comparison with its rivals?
Over the past five years, CVS has been nothing short of a growth machine. Between 2009 and 2013, the drugstore chain's revenue rose 29% from $98.2 billion to $126.8 billion. This rapid growth resulted, in part, from an 8% jump in store count, but the largest contributor to the company's revenue growth was its comparable-store sales, which rose an aggregate 18% during this five-year period. This increase in sales was accompanied by a big improvement in net income, which rose 24% from $3.7 billion to $4.6 billion on higher revenue, but higher costs also negatively affected the company's performance.

Walgreen also demonstrated growth during this time frame, but it was nowhere near what CVS delivered to investors. Between 2009 and 2013, Walgreen's revenue rose a modest 14% from $63.3 billion to $72.2 billion, driven almost entirely by a 14% jump in the number of locations in operation.

CVS Revenue (Annual) Chart

CVS Revenue (Annual) data by YCharts.

Meanwhile, the company's timid comparable-store sales growth of 2% helped, but it didn't come even close to that of CVS. This increase in sales, combined with the share of profits the company received from Alliance Boots, helped push Walgreen's net income up 22% from $2 billion to $2.45 billion.

Undoubtedly, the worst player in the drugstore space over the past five years has been Rite Aid. During this period, the company's revenue declined nearly 1% from $25.7 billion to $25.5 billion. Unlike its rivals, Rite Aid had to close stores (4% of them) in an effort to reduce costs and change its business from a money-losing one into a profitable enterprise.

Fortunately, Rite Aid's falling sales were cushioned by a 0.8% increase in comparable-store sales over this period. Although this looks bad when placed next its peers's results, Rite Aid's management team was able to restructure the company to turn its net loss of $506.7 million into a gain of $249.4 million.

Foolish takeaway
Right now, CVS is not only the largest drugstore chain in the business, it's also the fastest-growing one and it has shown enviable profit growth. For these reasons, it's hard to dismiss it as an investment prospect. In fact, with its historical performance, the company might be a very attractive long-term pick for investors who are looking for a strong market leader. However, for those looking to buy into smaller businesses that are in the process of improving their metrics, both Walgreen and Rite Aid might make for nice alternatives.

Daniel Jones has no position in any stocks mentioned. The Motley Fool recommends CVS Caremark. 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.