Walgreen (NYSE:WAG) continued its run of tremendous growth through its fiscal third quarter, pushing its stock close to its highest price ever yesterday. The company continues to profit from robust pharmacy sales and its revamped digital photography business.

In its third quarter, Walgreen generated earnings of $411 million, or $0.40 per diluted share. That's a healthy increase of 20.1% over last year, and was helped by a later flu season this year. Sales were also higher, increasing 13.1% to $10.8 billion. Comp sales, which include only those locations that have been open for at least a year, climbed 8.7% overall.

Walgreen continued to benefit from its strong pharmacy business. It expanded its pharmacy market share in the first three months of 2005 in every state in which it operates. Prescription sales climbed 14% and accounted for 65% of total sales in the quarter. These positive trends should continue for some time, considering the company controls about two-thirds of all retail prescription growth in a couple of key states, including the mature Florida market.

The company's gross margins also remain healthy, increasing 94 basis points to 27.85%, thanks in large part to an increase in the sale of generic drugs. Although generic drug sales slowed total sales growth due to their lower prices, their higher margins boosted the bottom line.

But there is more to Walgreen than prescriptions. The company has benefited handsomely from its investment in digital photography printing. The investment in the new technology may have hindered growth in the second quarter, but it is now reaping rewards.

Walgreen also hopes to regain the top spot from CVS (NYSE:CVS), which became No. 1 in number of stores via its acquisition of Eckerd. Walgreen opened 391 stores over the last year, bringing its total to 4,805. It remains on target to reach its goal of 365 net stores growth and 440 total openings. In fiscal 2006, it plans to generate net store growth of 390 locations as it methodically chips away at CVS, which operates 5,409 stores. But, even with fewer locations, Walgreen manages to generate higher revenues than its rival.

Walgreen is clearly well-positioned as a dominant player in a lucrative market that includes other heavyweights like Wal-Mart (NYSE:WMT) and Rite Aid (NYSE:RAD). Despite its lofty share price, it may be the perfect prescription for those investors seeking healthy returns.

Philip Durell of Motley Fool Inside Value has access to much cheaper prescription drugs up in Canada, where he lives. As a value guy, that pleases him.

Fool contributor Mike Cianciolo welcomes feedback and doesn't own any of the companies in this article.