Retail drugstores have been long regarded as relative safe havens for investors looking to steer clear of broader market turbulence. Prescription drugs are generally viewed as necessities and, thus, are not typically discretionary in nature. Therefore, one would assume that the industry has been enjoying great success given the ongoing economic uncertainty plaguing the United States.

However, this group has been far from immune from recent market volatility.  Many Americans are choosing to cut back on, or even forgo, prescriptions not deemed imperative. Same-store sales growth has slowed considerably, with even industry stalwarts reporting disappointing top- and bottom-line results of late.

Take, for example, CVS Caremark (CVS) and Walgreen (WAG). They are two of the nation’s leading pharmacy services providers. Together, they operate more than 14,500 retail drugstores in all 50 states, plus Puerto Rico, Guam, and the District of Columbia. They’ve dominated the industry for decades, filling more than 125 billion prescriptions last year alone. Each sits atop the group for most operating metrics, using unparalleled size and scale to achieve industry leading sales and profits.

Both, however, have fallen on hard times. CVS reported a 3% sales slip in the second quarter, resulting in flattish earnings, while Walgreen saw earnings decline 9% on slowing same-store sales growth. Although Walgreen’s struggles were in part a result of increasing costs, both companies’ sales were affected by the difficult operating climate.

And neither stock has been spared. Both have been on a downward trajectory since the start of the year. CVS no longer stands out for Timeliness and Walgreen is now ranked to trail the Value Line Investment universe over the next six to 12 months.  

But, while we concede that the sector’s near-term prospects are uncertain, we remain confident that the group will deliver healthy gains over the coming 3 to 5 years. Both CVS and Walgreen reported consistently solid results over the last decade. The recent economic downturn has been particularly deep and long lasting. It is unreasonable to expect these companies to be able to maintain top-line growth in such a climate, especially given their vast front-end (non pharmacy) businesses. Both, however, are well positioned for a long-term recovery, in our opinion, based on favorable demographics and the growing demand for prescription drugs we envision going forward.

Specifically, CVS Caremark is unrivaled in terms of the size and scope of its business. A perennial retail powerhouse, it changed the industry landscape forever when its early 2007 marriage brought together the top drugstore chain and one of the nation’s leading pharmacy benefits managers (PBM). Until this point, retailers and PBMs were mutually exclusive, essentially competing for the same business. BPMs were rising to recognition, thanks mainly to their mail order businesses and the ability to reduce operating costs. The merger was a means to give CVS an instant footprint in this rapidly growing niche.

Although the union has come under some fire, with some questioning the capabilities and wherewithal of the new regime’s ability to attract and preserve customers, recent results seem to suggest that there is light at the end of the tunnel. CVS’s PBM lost billions of dollars in contracts in 2010 and has come under investigation by the Federal Trade Commission and other regulators for suspicions of unfair business practices. But the inquiry has not turned anything up yet and the Caremark unit appears to be gaining back some momentum, with a handful of key deals bolstering management’s credibility. For instance, it recently entered into a deal to administer nearly $10 billion in annual drug spending for Aetna.

Plus, CVS has been extremely aggressive in making acquisitions. In fact, sans the Caremark hiccup mentioned earlier, the company has been quite successful in avoiding integration snags and has been able to uncover the full earnings potential of mergers in a relatively timely fashion. Although the Caremark deal has limited the company’s flexibility a bit, strong cash flow ought to enable it to get on its feet shortly and, more importantly, back on the growth path.

Although Walgreen has not, by historical standards, been as active on the M&A front as CVS, there is evidence suggesting that it is getting more aggressive here. It recently inked a deal to buy over 250 Duane Reade stores (see our earlier article: Take 250 or so of These and Call Us in the Morning). The move was significant not only because it showcased management’s ability to keep up with the likes of CVS, but because it gave Walgreen an immediate and fairly inexpensive means to penetrate the highly sort after New York City market. NYC is considered the most lucrative market in the United States, but pricey real estate has long kept competitors at bay.

Contrary to most others in the group, Walgreen still has a hefty cash pile and the flexibility to continue taking advantage of a highly fragmented and consolidating industry. Meanwhile, management appears content on retiring outstanding shares, which should also benefit shareholders, long-term. And, despite the current problems, the company just increased its quarterly dividend 27%, to $0.175 a share. Its current dividend yield stands at about 2.6%.

At the time of this article’s writing, the author did not have positions in any of the stocks mentioned.