Last Friday, Walgreen (WBA -0.84%) reported quarterly results and the company fell short on revenue but surpassed analyst expectations for earnings per share. This came a day after rival Rite Aid (RAD 24.00%) released results in-line with estimates but disappointed on its full-year outlook, which sent shares down more than 10% by the end of the day. After these results, is Walgreen an attractive prospect or is Rite Aid or CVS Caremark (CVS -0.80%) a better opportunity?

Walgreen's results were mixed but good
For the quarter, Walgreen reported revenue of $18.3 billion. This represents a 5.9% gain compared to the $17.3 billion the company reported for the same quarter a year ago, but it came in just shy of the $18.35 billion that Mr. Market anticipated. According to the company's press release, the primary driver behind the jump was a 5.4% rise in comparable-store sales. However, the addition of 142 more stores since last year also helped the company's top line.

On the bottom line, net income for the world's second-largest drugstore chain rose 68.3% from $413 million to $695 million. Offset by an increase in shares outstanding, this resulted in an increase in earnings per share from $0.43 to $0.72, matching analysts' expectations.

Looking at Walgreen's press release, we can see that the difference between the company's earnings-per-share growth and its revenue growth stemmed primarily from lower selling, general, and administrative expenses. Compared to last year, these expenses fell from 25.4% of revenue to 23.9%. In addition to this, the company saw other miscellaneous income totaling $225 million that it hadn't seen the year before and which was accretive to net income.

Is being in the middle of the road a positive for Walgreen?
Putting Walgreen, Rite Aid, and CVS side-by-side reveals some very interesting things.

Source: MSN Money

As we can see in the table above which shows the net profit margins of these three big players, each company has performed quite differently over time. Looking back over the past five fiscal years for each company we see very different stories. For instance, Walgreen has been consistently inconsistent but its net profit margin has stayed in an acceptable range of 3%-3.8%.

On the other hand, the picture shown by Rite Aid is far clearer. Since 2009, Rite Aid has shown an almost annual improvement in its net profit margin (albeit from a low base in negative territory). As management has focused more heavily on improving the company's cost structure, its bottom line has steadily improved and it is now positive. While there's no guarantee that Rite Aid's results will eventually reach those seen at Walgreen, the company appears to be on its way.

The trend experienced by CVS has also been relatively clear. Over the past five fiscal years, the 40.8% revenue growth seen by CVS has significantly outpaced the 14% experienced by Walgreen and the -3.4% reported by Rite Aid. However, the company has grown to this extent at the cost of profitability. During that timeframe, CVS's net profit margin has declined almost annually from 3.7% to 3.1% as the company has shown that it is willing to forego profit now for market share later. CVS' average net profit margin is the highest of the bunch at 3.5% but this could continue to fall as time goes on if it cannot effectively leverage its market power.

Foolish takeaway
Based on the data presented above, we can conclude that Walgreen's results were good but not great. The company failed to impress on revenue but matched expectations when it came to earnings per share. This is, undoubtedly, a strong sign that the business is alive and well but a warning that it's not growing quite as fast as Mr. Market hoped it would.

Compared to Rite Aid, Walgreen appears to be in a far better position. If Rite Aid can maintain its course, then it may find itself having to compete against more than just CVS. On the other hand, CVS is growing the fastest of the bunch but it appears to be doing so at the expense of profit. This suggests that CVS believes establishing a Wal-Mart-like position will offer the company a long-term competitive edge, but it also indicates that the company's fundamentals can deteriorate rather quickly should business take a turn for the worse.

For these reasons alone, it's not hard to see the pros and cons of each investment. Rite Aid is stuck trying to improve margins in an effort to turn around and, eventually, grow, while CVS is doing all it can to gobble up market share. Meanwhile, Walgreen is a nice middle-of-the-road kind of investment because it's focused on achieving reasonable growth while preserving its margins.