Federer played a more aggressive game than the Spaniard but 27 unforced errors cost him a place in the final against the unseeded Massu, who continued his outstanding run of form with a 7-5, 6-4 victory over Moroccan 15th seed Younes El Aynaoui.
"I wasn't too happy with my game," Federer said after a defeat that could prove costly in his three-way battle with Ferrero and Andy Roddick for the number one spot come the end of the year.
"I took chances on my serve and double faulted. That shouldn't happen."
Ferrero took just 30 minutes to win the opening set with a single break, as the Spanish top seed's serve proved the dominant weapon.
Federer hit back in the second set and clinched it in the final game, Ferrero making an uncharacteristic forehand mistake from his opponent's chipped return on the first of two break points.
Ferrero looked uncomfortable early in the deciding set but Federer was unable to put him under any real pressure, missing too often with a series of ambitious returns.
Ferrero edged ahead in game five, cracking a forehand return to set up a break point and producing another rattling winner to take it and move 3-2 ahead.
Federer managed to hold in his next service game, despite being under pressure at 15-30, but could not make any headway against the Ferrero serve.
Ferrero's only wobble came in the final game, when Federer saved three match points from 0-40, but the Spaniard stuck to his task and clinched victory in one hour 51 minutes when his opponent struck a forehand long.
"I served really well," said Ferrero. "He only got one break in the whole match and that's on an indoor court, with everything going so quickly."
Ferrero can strengthen his position as number one on the ATP entry system, with three weeks of the season left, by beating Chile's Massu in Sunday's final but he expects a tough battle.
"Massu's tennis has been very consistent, without many unforced errors," Ferrero said. "Besides, he's very fit and has good stamina."
Massu certainly proved too consistent for El Aynaoui, who was hampered by a foot injury in their semi-final.
Massu won through to his first Masters Series final with a comprehensive victory, completed in 100 minutes in the first match on centre court.
Massu, who becomes only the second Chilean after Marcelo Rios to reach a Masters Series final, got the crucial first-set break in game 11, when El Aynaoui smacked a backhand long at 30-40.
The 32-year-old El Aynaoui lost his first service game of the second set and, with Massu continuing to rifle winners from the back of the court, the Moroccan never had a chance to come back.