Shares of CVS Caremark (NYSE: CVS) galloped to a 52-week high on Wednesday. Let's take a look at how the company got there and whether clear skies remain in the forecast.

How it got here
CVS Caremark's success has come at the hands of multiple failures by its competitors. During its recently ended quarter, CVS reported that an ongoing dispute between Walgreen (NYSE: WAG) and Express Scripts (Nasdaq: ESRX) over prescriptions led to an additional 5.7 million to 6.5 million prescriptions being filled at its pharmacies during the quarter, according to CEO Larry Merlo. In addition, Rite Aid's (NYSE: RAD) seemingly never-ending turnaround has yielded a continuing stream of customers moving away from Rite Aid and into CVS' stores.

Even if you remove the Walgreen-Express Scripts event from the equation, CVS Caremark's growth has been strong. Total pharmacy sales jumped 10% this past quarter as total sales jumped 8%. This also takes into account the negative impact that generic drugs had on margins and a weaker-than-normal flu season (though tell that to this writer). CVS also raised earnings guidance for the remainder of the year, which was above the Street's estimates and became the final hurdle for CVS to clear in order to hit a new high.

How it stacks up
Let's see how CVS Caremark stacks up next to its peers.

CVS Chart

CVS data by YCharts

Wal-Mart (NYSE: WMT) has considerably more diversified business segments than CVS, but based on pharmacy operations alone, CVS has everyone else on the run.

Company

Price/Book

Price/Cash Flow

Forward P/E

Dividend Yield

CVS Caremark 1.6 10.6 12.4 1.5%
Walgreen 2.0 9.0 11.8 2.6%
Rite Aid NM 4.8 NM 0%
Wal-Mart 2.8 8.5 11.2 2.7%

Source: Morningstar. Yields are projected; NM = not measurable.

The pharmacy benefits management sector is actually quite profitable -- unless your name is Rite Aid. That franchise has struggled since its purchase of Eckerd and is mired under too much debt to be a serious buy consideration. Walgreen offers value investors a growing dividend and a marginally cheaper valuation than CVS Caremark, but take into account that cheaper valuation comes at the expense of potentially millions of prescriptions. Wal-Mart is an investment I won't argue against, as it is a staple of consistency, but from a pharmacy benefits standpoint, no one is growing even nearly as quickly as CVS at present. Considering CVS is valued below two times book, one could assume it has plenty of room left to run to catch up to its peers.

What's next
Now for the real question: What's next for CVS Caremark? That answer is going to depend on whether CVS makes the transition smooth for customers moving from Walgreen and Rite Aid, and whether it can continue to satisfy income-investors' need for a tastier dividend. Recent dividend increases have been nice, but it's still lagging Walgreen significantly in the yield column.

Our very own CAPS community gives the company a highly coveted five-star rating, with an overwhelming 96.1% of members expecting it to outperform. Surprisingly, I have yet to make a CAPScall on the popular company yet, but that doesn't mean it's not on my radar.

As of now I'm erring toward placing the stock in my CAPS portfolio with an outperform rating, but would personally like to see the stock pull back from these levels. Eventually, Walgreen is going to resolve its dispute with Express Scripts and will stop bleeding customers to CVS. The question then will be how well CVS can grow its pharmacy business without its competitors fumbling the ball. With analysts expecting CVS to grow by 11% annually over the next five years, I feel it's still safe to consider the company a solid investment moving forward, but I will opt to wait for a pullback before I enter my CAPScall of outperform.

Craving more input on CVS Caremark? Start by adding it to your free and personalized Watchlist. It's a free service from The Motley Fool to keep you up to date on the stocks you care about most.

If you'd like the inside scoop on three more stocks that will help you retire rich, get free access to our latest special report.