Rite Aid (RAD -20.53%) recently reported February comps (same-store sales) numbers, which were positive. Walgreen (WBA -0.93%) also recently reported comps numbers for February, and CVS Caremark (CVS -1.62%) reported comps numbers for its fourth-quarter and full year.

If you look at the industry as a whole, then it would be difficult to make a mistake from an investment perspective. On the other hand, you might want to consider some important numbers and facts if you're looking for the best long-term investment. 

riteaid.com

Aiding investors
Over the past five years, Rite Aid has seen stock appreciation of 447%, whereas Walgreen and CVS have seen stock appreciations of "only" 73% and 134%, respectively.

When three similar companies in an industry deliver positive underlying results, the smallest company will often see the most stock appreciation during bull markets. Investors want to maximize their opportunities during these times. On top of that, and perhaps more important in this case, is that Rite Aid's net income has skyrocketed over the past five years. When you look at the chart below, also notice that SG&A expenses have remained relatively flat -- a good sign:

RAD Net Income (TTM) Chart

RAD Net Income (TTM) data by YCharts

Rite Aid's turnaround on the bottom line has been impressive. On the other hand, revenue has declined 0.03% over this time frame. Comparatively, CVS and Walgreen have enjoyed revenue increases of 41.57% and 17.68%, respectively, over the past five years. 

Rite Aid's February comps improved 1.5% year-over-year. Front-end sales slid 1.8%. According to Rite Aid, 0.5% of this decline was due to weakness in flu-related over-the-counter products. A weak flu season (fewer incidents than normal) affected the whole industry. In Rite Aid's case, even if you remove the 0.5% due to weakness for flu medicines, front-end sales still declined 1.3%. It's going to be difficult for the drug stores to compete with the likes of Wal-Mart's small-box stores (in expansion mode) and the dollar stores at the front end of the store going forward. Therefore, those performing best at the back end of the store should offer better odds of long-term success. With that in mind....

Rite Aid's pharmacy comps increased 3.1% (includes an 138 basis-point negative impact due to new generic drugs), and prescription count declined 1.4% (with a 1.3% impact due to fewer flu-related prescriptions). Once again, if you remove the flu impact from the prescription count comps, it's still a negative number -- 0.1%.

(walgreens.com) 

Not Wagging the dog
Walgreen's February was more impressive, with comps growing at 4.5%. Without the negative generics impact of 0.9%, comps still increased 3.6%.

Unlike Rite Aid, Walgreen's front-end comps improved 2% despite customer traffic declining 0.7%. Basket size played a big role in this as it saw an increase of 2.7%. Additionally, prescriptions filled increased 2.2%. Excluding a negative impact due to fewer flu incidents, prescriptions filled still increased 1.2%.

Walgreen has another big long-term advantage. Along with Alliance Boots, Walgreen owns a stake in Amerisource Bergen Corp. (COR 0.35%). By taking this stake, Walgreen has set itself up for success in the generic space, which is in-line with industry trends. By buying generics in bulk, Walgreen will be able to negotiate better prices, which should lead to higher margins and an improved bottom line.

cvs.com

Setting a record
CVS saw retail pharmacy comps increase 4% in the fourth quarter, which was on the high end of expectations. For fiscal-year 2013, retail pharmacy comps improved 1.7%.

CVS President and Chief Executive Officer Larry Merlo said:

I am very pleased with our fourth quarter results, which came in at the high end of our expectations and helped produce a record year. As expected, the quarter was somewhat atypical, largely due to the timing of Medicare Part D profits within the PBM and the timing of break-open generics across the enterprise. Overall, the year 2013 produced strong growth in revenues, gross margin, operating margin, and earnings across the enterprise.

Cash flow advantages
Over the past year, Rite Aid has generated operational cash flow of $728.27 million. It's good to see positive cash flow, but this is nothing compared to Walgreen and CVS, which have generated $3.83 billion and $5.78 billion in operational cash flow over the same time frame. Smaller companies can hold their own, and even thrive, when the world is bullish, but when the tide goes out, the most fiscally sound companies often outperform their peers. 

An investment perspective
Rite Aid might be the hottest investment of the three right now, but if you're looking to invest in the strongest underlying business with the best odds of long-term success, then it's likely to be Walgreen or CVS, with Walgreen holding a slight edge thanks to its Amerisource Bergen deal. Walgreen also offers a dividend yield of 1.90%, whereas CVS yields 1.50%. Rite Aid doesn't pay a dividend. Please do your own research prior to making any investment decisions.