With Rite Aid (NYSE: RAD) reporting its third quarter earnings on Thursday and Walgreen (NYSE: WAG) reporting on Friday, this is bound to be a big week for drugstore chains. Heading into earnings, what can we expect of both of these companies and how do they stack up against rival CVS Caremark (NYSE: CVS), the largest player in its industry?

Expectations are high for Walgreen but low for Rite Aid
For the quarter, analysts are fairly optimistic about Walgreen's prospects. If earnings estimates are correct, Walgreen will report earnings of $0.73 per share. This implies that earnings for the second largest drugstore chain in the world may beat the $0.58 it reported the same quarter last year by a whopping 25.9%.

Mr. Market expects this earnings beat to be partially attributable to an increase in revenue. If accurate, revenue for the company will come in at $18.36 billion, 6% higher than the $17.32 billion it reported last year. Though it's possible the rest of the increase in earnings could come from cost reductions relative to sales, it's more likely than not that decreased share count will be a more significant contributor.

Looking back over the past five years, Walgreen's net profit margin has averaged 3.3% with little variation from year to year. If cost reduction were the primary means through which earnings could jump so much, you would expect to see this ratio improve over time. Year-to-date, some improvement has been made in decreasing both the company's cost of revenue and selling, general and administrative expenses as a percentage of sales. However, the longer-term trend has been to reduce shares outstanding as management has gradually engaged in share repurchases over the past few years.

Unlike Walgreen, Mr. Market doesn't seem to be expecting much from Rite Aid. For the quarter, earnings per share is expected to come in at $0.04. This represents a 42.9% drop from the $0.07 the company reported the same quarter a year ago.

Analysts believe revenue will come in at $6.32 billion, 1.3% higher than the $6.24 billion the company reported the same quarter a year earlier and 0.2% lower than the $6.33 billion management previously estimated. This suggests that earnings will drop either due to higher costs or more shares outstanding.

In Rite Aid's most recent quarterly report, management outlined that while the greater adoption of generic drugs has impaired revenue, the lower costs have meant higher margins. Though this trend could, in theory, reverse, it's unlikely that earnings would be so negatively affected by it. Rather, it's likely that greater shares outstanding could impair the company's earnings results as management has been issuing more shares in the hopes of raising adequate amounts of capital.

Three Shades of Grey
Over the past five years, each of the three big drugstore chains has performed very differently. CVS, for instance, has seen its revenue explode, growing 40.8% from $87.5 billion to $123.1 billion. Though not as extreme, Walgreen has also demonstrated its ability to grow as revenue has increased by 14% from $63.3 billion to $72.2 billion over the same timeframe. Rite Aid, on the other hand, has been the oddball.

For the past several years, Rite Aid has been stuck in rut. Facing significant net losses every year from 2008 through 2012, management has been focused not on growth but, instead, on improving its bottom line in an ever more challenging competitive environment. As a result of this, revenue has actually fallen 3.4% from $26.3 billion to $25.4 billion since 2009. However, the company's cost-cutting efforts, combined with the help its received from a higher mix of generic drugs, has caused its net income to rise from -$2.9 billion in 2009 to $118.1 million in 2013.

Though this lack of attention to revenue growth may appear concerning when both of its peers are grabbing marker share, it's difficult to argue that Rite Aid's missing out on much. Over the past five years, Walgreen has failed to convert its higher sales into higher margins, while CVS has actually experienced a mild downturn in its net profit margin from 3.7% to 3.1%.

Foolish takeaway
As we can see, the market has somewhat mixed expectations for Rite Aid and Walgreen. This disparity could present investors with a great deal of upside or downside in the event that Mr. Market is wrong about the prospects of each. However, instead of trying to guess who may or may not beat on earnings, the Foolish investor would be wise to make their pick based on the past results of each company.

Using this thought process, investors are left with a choice. You can invest in CVS, which has had a history of booming revenue but deteriorating margins as it tries to grab as much market share as possible. On the other hand, you can invest in Walgreen, which is growing revenue at a much slower pace but doing so without jeopardizing its profitability, or you can invest in Rite Aid, which is seeing a decline in revenue but significant margin improvement. In truth, none of these companies appear to be a layup, but I don't believe that investing in any one of them would be necessarily stupid as they all have something positive for investors to take comfort in. As always Foolish investors should do their own research before making any investment decisions. 

Social Security plays a key role in your financial security. In our brand-new free report, "Make Social Security Work Harder For You," our retirement experts give their insight on making the key decisions that will help ensure a more comfortable retirement for you and your family. Click here to get your copy today.

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