Oh how quickly things change!  Investors frustrated by Rite Aid Corporation's (RAD) downbeat guidance just two weeks ago are breathing easier thanks to better-than-hoped sales in December.

Quickening sales pace

Strong results at Rite Aid's pharmacies helped same store sales at the retailer's 4,592 stores improve by 2.9% in December compared to a year ago. That was a bit better than the 2.7% growth reported in November.

Despite a 1% negative impact from generic introductions in 2013 and a 2% drop in prescriptions filled, sales at Rite Aid's pharmacies, which represent nearly 64% of Rite Aid's sales, sales grew by 4.1% in December

But scripts filled are flat year-over-year for the first 43 weeks of the Rite Aid's fiscal year. Some of that December drop is tied to hard-to-predict flu shots and flu prescriptions, suggesting investors shouldn't get too nervous about December's slide in prescriptions filled.

In total, the 2.9% same store growth handily outpaced the 0.5% same store gain over the past 43 weeks.  And the 1% front end sales growth, which is supported by an aggressive roll-out of the retailer's Wellness platform, effectively trounced the 0.1% front end growth so far this fiscal year.

Turning store growth into profit

In a bid to further strengthen its business, Rite-Aid continues to cut unprofitable stores. Those cost saving measures, coupled with more aggressive marketing, have helped Rite-Aid return to profitability

RAD EPS Diluted (TTM) Chart

RAD EPS Diluted (TTM) data by YCharts

Cost-cutting has reduced selling, general, and administrative costs to 25.67% of revenue from 25.85% in the third quarter, helping net income climb to 1.13% of sales from 0.99% last year.

The profit improvement is allowing Rite Aid to clean up its balance sheet, with cash climbing to $183 million from $129 million and long term debt dropping to $5.82 billion from $5.90 billion since March.

More work to do

Despite Rite Aid's improving numbers, the company still trails its larger competitors CVS (CVS 0.25%) and Walgreen (WBA -0.35%). Both CVS, with its high profile acquisition of Caremark in 2006, and Walgreen, fresh on the heels of a deal with drug distributor AmerisourceBergen, have moved to diversify their business away from brick and mortar. CVS and Walgreen's larger scale and faster adoption of margin friendly health care services, such as CVS's MinuteClinics, gives each operating margins significantly higher than Rite-Aid.

RAD Operating Margin (TTM) Chart

RAD Operating Margin (TTM) data by YCharts

That margin advantage is keeping CVS and Walgreen's valuation in check. The more speculative Rite Aid offers the highest forward P/E ratio of the three at 16.18.

Fool-worthy final thoughts

Hopes are likely high at Rite Aid, CVS, and Walgreen for 2014. While generic drugs carry lower prices which impact top line sales, they're more profit-friendly. That suggests a reacceleration from the recent slowdown in high profile patent expirations, commonly known as the patent-cliff, this year and next year could drive profit higher.

Despite worries over slow enrollment, a bump up in Medicaid enrollment and acceleration from the tepid rate of enrollment in private plans tied to the Affordable Care Act should also help drive script volume in 2014.

Another company you must watch this year