The country's largest drugstore chain is having a wild 2012. Shares of Walgreen (NYSE: WAG) are down about 11% so far this year, after a messy breakup with Express Scripts (Nasdaq: ESRX) that crippled the company's annual pharmacy sales. Worse still, Walgreen's decision to drop its contract with the pharmacy benefits manager drove thousands of customers into the arms of its largest competitor, CVS Caremark (NYSE: CVS). While there are pros and cons to both of the pharmacy stocks, only one looks like an attractive buy today.

Round 1 goes to CVS 
Both CVS and industry peer Rite Aid (NYSE: RAD) now have something Walgreen does not: a prescription service that accepts Express Scripts insurance plans. As a result, both companies have benefited from an influx of former Walgreen customers who were forced to transfer their prescriptions to pharmacies that honor benefits for Express Scripts' members.

Meanwhile, pharmacy sales at Walgreen continue to slide. Last week the company reported third-quarter results that showed a 10.8% decline in net earnings from the same period a year ago, and prescription sales fell 6.6%. That contrasts with CVS Caremark's latest quarter, in which the company reported a 19.9% increase in net revenue and a 32.3% rise in pharmacy services compared to the same period a year ago.

Still, it's too early in the game to name CVS the winner.

Express Scripts may have accounted for more than 12% of the prescriptions filled at Walgreen stores, but the pharmacy retailer still looks strong on a fundamental basis. Also, Walgreen's healthy balance sheet paired with the sheer size of its operations (8,000 stores in the U.S. and Puerto Rico) will help insulate the company from the loss of Express Scripts customers.

Dueling dividends
Dividends and healthy financials are also important factors to consider. Last week Walgreen announced a dividend hike -- increasing its quarterly payout by more than 22% to just over $0.27 a share. For those keeping score, that translates into an annual dividend of around $1.10 per share. The stock currently boasts an attractive dividend yield of 3.7%.

Looking to the future, the company hopes to reward shareholders with a payout of between 30% and 35% of total net earnings. Walgreen has paid a dividend for more than 79 years or 319 consecutive quarters, meaning the company should have no problem making future payouts. That's reassuring considering industry rival Rite Aid can't even afford to pay a dividend.

WAG Dividend Yield Chart

WAG Dividend Yield data by YCharts

With a yield of 1.40%, CVS Caremark's dividend also looks reliable, though not as rich as Walgreen's payout. Still, dividends have helped shares of CVS return an average of 13% annually since 1980 -- beating the S&P 500's annual return of 11.1% over the same period. Today, CVS pays an annual dividend of $0.65 with a price-to-earnings ratio just north of 17. That compares to Walgreen's annual dividend of $0.90 and a P/E just below 10. As far as these metrics are concerned, Walgreen wins this round.

Walgreen gets the boot
Walgreen may get points for its strong balance sheet and attractive payout. However, the company's recent $6.7 billion play for a portion of European pharmacy chain Alliance Boots adds a new level of risk to the stock. The expensive takeover deal will leave Walgreen with a 45% stake in Boots and more than 11,000 drugstores throughout the U.S., Europe, and Asia.

According to The Wall Street Journal, Walgreen hopes to make $1 billion in cost synergies by 2016.

I liked the value in shares of Walgreen before this deal was announced; the stock was a good play for conservative investors. But the company's decision to buy Boots gives shares of Walgreen major exposure in Europe during a time when the region is under tremendous pressure. Another reason for concern is the fact that Walgreen is taking on billions in debt in order to fund the cash-and-stock deal.

Additionally, the U.K. tie-up of these companies means Walgreen will need to navigate British drug regulations, which differ from those in the United States. It seems to me that the pharmacy retailer is paying a premium for added problems. Perhaps this is a desperate attempt by Walgreen to replace revenue lost in the absence of Express Scripts.

Whatever the logic, one thing is certain: CVS is looking a lot better in light of Walgreen's costly purchase. For that reason CVS is undoubtedly the better buy today. With the competition preoccupied by this risky takeover deal, I suspect more investors will be focusing their attention on CVS. In the meantime, I'm giving shares of Walgreen an underp erform rating in Motley Fool CAPS.

With so many stocks to choose from, the better buy isn't always the obvious choice. Fortunately, our top analysts have compiled this free report revealing two winning retail stocks you should own today. Click here to get your free copy of "The Real Cash Kings Changing the Face of Retail."