CVS Caremark Corp posted a bigger-than-expected rise in quarterly profit on Thursday as its pharmacy benefits business improved, and it expects this year's profit to be at the higher end of its prior forecast.

CVS shares rise 3.8 percent in afternoon trading.

The company, which operates the CVS drugstore chain and the Caremark pharmacy benefits management business, said Caremark got off to a good start in the current benefits selling season. Analysts were also pleased with the margins in that business, which had been under pressure in recent years.

Pharmacy benefit managers, or PBMs, administer drug benefits for employers and health plans.

With nearly 70 percent of its contracts up for renewal in 2012 completed so far, Caremark had a 98 percent retention rate.

Walgreen Co plans to leave Express Scripts Inc's network starting in 2012. Since CVS competes with Walgreen and Caremark competes with Express Scripts, it remains to be seen just how much CVS Caremark can benefit if that relationship ends.

It is too early to see any material lift from that spat, CVS Chief Executive Larry Merlo said on a conference call.

It's our opinion that (CVS Caremark) are pretty well positioned to benefit from that, however it goes, just because any time there is customer disruption, you would like to be the guy that doesn't have any, said Edward Jones analyst Judson Clark.

Clark, who has buy ratings on CVS, Walgreen and Express Scripts, said that he still expects Walgreen and Express Scripts to reach a deal by the end of the year.

At the same time, Express Scripts Inc is working on buying Medco Health Solutions Inc , a deal that could affect business at both CVS and Walgreen.

Walgreen said on Thursday it expects to achieve 97 percent to 99 percent of its fiscal 2011 prescription volume in fiscal 2012, a forecast that does not include any assumption on Express Scripts' pending acquisition of Medco.

PROFIT RISES

Net income attributable to CVS Caremark rose to $868 million, or 65 cents per share, from $809 million, or 59 cents per share, a year earlier.

Adjusted earnings per share from continuing operations attributable to CVS Caremark rose to 70 cents from 64 cents, topping CVS's forecast of 66 to 68 cents and analysts' average forecast of 68 cents, according to Thomson Reuters I/B/E/S.

Revenue rose 12.5 percent to $26.67 billion, while analysts were looking for $26.75 billion.

Revenue in the pharmacy services business jumped 25.8 percent to $14.8 billion, due largely to the addition of a previously announced major contract with Aetna Inc and the acquisition Universal American Corp's Medicare prescription drug business.

Revenue in the drugstore unit, which operates more than 7,300 stores and accounts for roughly half of total revenue, rose 3.8 percent to $14.7 billion. Sales at stores open at least a year, or same-store sales, rose 2.3 percent.

Consumers remain pretty cautious, a move that weighs on sales but can also help profitability as they switch to the chain's own branded goods, which carry higher margins, Chief Financial Officer Dave Denton told Reuters in an interview.

The outbreak of flu so far this season has been modest, leading to lower flu-related prescription volume, though the company has been administering more flu shots, he said.

Meanwhile, Walgreen's October same-store sales rose just 2.6 percent, falling short of analysts' average forecast for a rise of 4.9 percent, according to Thomson Reuters data. Walgreen has administered fewer flu shots than it had by the same time last year, it said.

CVS expects to post adjusted earnings from continuing operations of $2.77 to $2.81 per share this year, trimming 2 cents off of the low end of the range it gave in August. Analysts' average 2011 forecast is $2.78 per share.

It will give more outlook at a December 20 analyst meeting.

Shares of CVS were up 3.8 percent to $37.12 in afternoon trading, while shares of Walgreen fell 1.3 percent to $32.56.

(Reporting by Jessica Wohl in Chicago, editing by Maureen Bavdek and Derek Caney)