Kubica was likely to replace Massa when his contract was over at Ferrari, but I can't see that happening now, Massa's contract ends at the end of this coming season and I highly doubt it'll be renewed. He'll probably slip into a midfield team.
However, Ferrari have always had 1 very good driver and one team player, they've never had two great drivers in the same team. They've got Alonso in there and they've wanted him for years now, since 2005 in fact. They'll replace Massa with another equal driver. What they want is a driver that can win races and a driver that can secure second place without causing worries about taking each other out, red bull style. Hence why they kept Barrichello so long alongside Schumacher. Schumacher won the races, and Barrichello secured second place (or there about) without threatening the title win by not allowing opponents to score too many points.
I think Heidfield would be a pretty decent driver for that. He's fast, but he's not the fastest. Give him a Ferrari and he'll pick up lots of top 5 places while Alonso sweeps up the podium.