CBS said Wednesday that it had acquired Last.fm, the online music service that allows fans with similar tastes to connect, for $280 million.