U.S. stocks edged lower on Friday, the final trading day of the year, as investors took profits after a recent rally that has the S&P on track for its best December performance in nearly two decades.

The benchmark index has gained 6.6 percent so far this month, closing Wednesday at its highest level since September 8, 2008, and has risen in 17 of the last 21 sessions. The index is on course for its biggest December gain since 1991, when it rose 11.2 percent.

From its July low the S&P has risen 23 percent, boosted by improving economic data, positive earnings reports and stimulus measures by the U.S. Federal Reserve. Investors will closely watch a host of data next week for any incentives to take profits or extend the rally.

We had a nice year, as far as percentage up, really good numbers for the year, said Terry Morris, senior vice president and senior equity manager for National Penn Investors Trust Company in Reading, Pennsylvania.

It's just drifting and it's entitled to a pullback. Then it will be like someone turned the switch on Monday.

The Dow Jones industrial average <.DJI> dropped 26.22 points, or 0.23 percent, to 11,543.49. The Standard & Poor's 500 Index <.SPX> lost 2.72 points, or 0.22 percent, to 1,255.16. The Nasdaq Composite Index <.IXIC> dipped 10.18 points, or 0.38 percent, to 2,652.80.

Volume is expected to remain weak as the U.S. government and many businesses are closed on Friday on observance of the New Year's holiday.

Drugstore chain CVS Caremark Corp agreed to buy Universal American Corp's Medicare prescription drug business for about $1.25 billion. Universal American surged 35.8 percent to $19.84, while CVS slipped 0.3 percent to $34.90. For details, see [ID:nN31133101]

U.S.-listed shares of IMAX Corp jumped 12 percent to $30.07 after Britain's Daily Mail reported that Sony Corp <6758.T> might bid at least $40 per share for the big-screen movie company.

(Reporting by Chuck Mikolajczak; editing by Jeffrey Benkoe)