Pharmacy chain Walgreen (WBA 0.57%) needs to stay on its meds. Its medications business, that is. The company posted some blowout earnings numbers today, sending its stock jumping 5% in midday trading, but it also highlighted what's wrong with the overall Walgreen retail plan. I think the stock gains it's made over the past year could be at risk.

Walgreen said fourth-quarter profits surged 86% year over year to $657 million, driven higher by prescription sales, which were up 6% from the year-ago period. It filled 203 million prescriptions, an increase of 8.2% over last year's fourth quarter. With meds accounting for nearly two-thirds of the pharmacist's revenues, it had a retail prescription market share of 19.1%.

That should lay to rest the worry many including myself had that it wouldn't be able to recover from its disastrous feud with Express Scripts, which saw many customers flee to CVS Caremark (CVS -0.22%) and Rite-Aid.

Yet Walgreen's front-end sales were weak. While its comps edged 1.6% higher in the quarter, that was largely because customers were buying more. Basket size increased 3.6%, but store traffic was down 1.9%, and that's where I think it's getting into trouble. This is a recurring problem, as last quarter it had the same scenario play out: falling comp traffic, but ultimately saved by bigger basket size.

CVS reported its second-quarter results in August and saw weaker front-end results than Walgreen did, but blamed it on a shift in the Easter holiday to the first quarter. Although that might have benefited Walgreen to a certain extent, as its previous quarter encapsulated the holiday, it may have something more to do with the pharmacy's effort to "blur" retail channels by selling more fresh food.

Walgreen figures that more customers coming to get prescriptions filled will spend more money on other things while in the store. A case could be made that's how its playing out as the average basket size grows despite fewer customers. Wal-Mart successfully offers its customers a wide variety of products, as well as a large and growing pharmacy business, giving them a one-stop shopping experience.

But Walgreen is no Wal-Mart, meaning it would do well to target its strengths without the sideshow distractions. It's obvious the prescription business is back on track and growing, and acquisitions like those made of Alliance Boots and Kerr Drug show management does know which side its bread is buttered on. But the comps tale tells a different story, one that suggests that if Walgreen only stopped trying to be too smart by half by trying out new gimmicks like hand-rolled sushi, baristas, and self-serve frozen yogurt, it could be even more a juggernaut of growth.

I find those ancillary operations a bit of a distraction, and the more they underperform its pharmacy business, the more attention management will pay to them. That raises the risk its core competencies will suffer and could send shares down once more.

Walgreen has marched back strongly from those dark days when it lost the Express Scripts account, but since then has seemingly had a bit of a schizophrenic personality, one dominated by the pharmacy business but weighed down by its rather chaotic retail side. Perhaps it should stay on its meds and really do one thing, but do it well.