Walgreen (NASDAQ:WBA) shares soared Tuesday as the company announced higher-than-expected quarterly profits and a new partnership with pharmaceutical distributor AmerisourceBergen (NYSE:ABC) and European drugstore Alliance Boots.

For the quarter, net sales were flat, but gross margin improved 120 basis points, leading to a 10.7% increase in net income for the quarter. Notably, net sales were only flat by virtue of opening new stores during the quarter, masking disappointing same-store metrics, which ended up somewhat complicated. Overall same-store sales were down several percentage points, while the average customer ticket went up, but customer traffic went down. So, essentially, customers are spending more, but there are too few customers for it to matter, which isn't a sustainable situation.

Exciting developments
Walgreen's sales have been slumping for a year now, though, so that isn't anything new. The real story is the AmerisourceBergen and Alliance Boots partnership. The partnership will help reduce some of Walgreen's operational costs, as AmerisourceBergen will begin distributing a number of generic pharmaceuticals that Walgreen traditionally self-distributed. AmerisourceBergen's superior supply chain will allow for greater efficiencies and daily deliveries.

Alliance Boots and Walgreen have also been granted the option to purchase a significant minority equity position in AmerisourceBergen, through warrants and equity totaling 21% of the company. Once Walgreen and Alliance Boots have together acquired at least 5% of AmerisourceBergen, a Walgreen executive will be placed on the board, and an Alliance Boots executive will be added upon exercise of the warrants.

Alliance Boots is essentially the Walgreen of Europe. Both companies are the largest retail pharmacies in their respective region, putting them in a good position to profit from aging populations that will increasingly need more prescription drugs.

Interestingly, Walgreen purchased 45% of Alliance Boots last summer and has the option to acquire the rest of the company in two years. In that event, Walgreen would have significant influence over AmerisourceBergen. This is part of Walgreen's plan to create a "global, pharmacy-led, health and well-being enterprise" -- an ambitious goal.

Launching the flagship
Barely mentioned Tuesday, but still important, is Walgreen's flagship strategy. The company is planning three new flagship stores over the next couple of months, in addition to the current four, which offer, among other things, professional manicures, a cafe, a smoothie bar, and a selection of premium cheeses, fresh sushi, and organic food.

Seven stores is hardly enough to move the needle on the company's declining sales, even if the flagship stores are doing well (Walgreen hasn't given information specifically about these stores). The stores are also bigger than 20,000 square feet, so even if the concept works, Walgreen can't just convert its existing stores to the same format. But it may be able to scale the concept down and use the flagship stores to attract attention and brand awareness, a key commodity in the retail market.

Competitors CVS (NYSE:CVS) and Rite Aid (NYSE:RAD) are also revamping their in-store strategies. CVS has added fresh sandwiches and salads to its stores, in an effort to grow non-pharmacy revenue and keep customers in the store longer. Rite Aid is going the other way with its new Wellness stores, which draw more attention to the pharmacy section and feature expansive departments for vitamins and supplements, caregiver tools such as bedpans, and organic food.

All three are competing with the likes of Wal-Mart (NYSE:WMT), which is typically known for its gigantic superstores, occupying around 100,000 square feet and selling about as many products. However, in 2011, the company introduced new Wal-Mart Express stores, which occupy about 15,000 square feet and sell 11,000 to 13,000 items -- comparable to a corner drugstore. During 2012, the Express stores generated double-digit same-store sales growth, compared to just 1.8%  growth for the company overall.  

The Foolish bottom line
Drugstores are facing heavy competition from each other and their big-box competitors, but the category itself stands to gain from an aging population in the U.S. and Europe. Walgreen's results this quarter may have been somewhat mixed, but its long-term goals could be extremely profitable. This is a company to keep your eye on. Add it to My Watchlist today to stay updated on any developments.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.