Alonso, who has won two previous F1 races, was aided by Sebastian Vettel's late-race accident, in which he lost power after starting on the pole and leading for two-thirds of the 49-lap race.
Alonso used the opening to pass Vettel and take the lead for good.
"It's a special day for me," Alonso said. "Obviously, coming back to the podium always is special, and it's even more special with Ferrari, with the history behind the team and the expectations a driver has when he drives for Ferrari. There's no better way to start the relationship."
Massa's second-place finish came in his first event after returning to racing from head injuries suffered in a high-speed qualifying crash in Hungary last July.
Yosemite climber falls 30 feet, suffers major injuries
Moore to attend retreat in to avoid Kutcher's wedding