Hamilton, the eventual Drivers' Champion, led the Championship going into the race, and started from pole position alongside Räikkönen.
Massa passed Räikkönen with seven laps remaining, to improve his chances of surpassing Hamilton's points tally at the final race in Brazil.
[3] The teams, also known as "constructors", were Ferrari, McLaren-Mercedes, Renault, Honda, Force India, BMW Sauber, Toyota, Red Bull Racing, Williams and Toro Rosso.
[7] The British press described Hamilton's move as "impetuosity and untamed aggression", saying that the McLaren driver would have to adopt a more conservative race strategy in China.
[9]With ten points on offer for the winner of the Grand Prix, it was possible that Hamilton would clinch the Championship in Shanghai.
[17] The Renaults were next quickest, ahead of Jarno Trulli of Toyota, Red Bull driver Mark Webber, Massa, Bourdais and Räikkönen.
Certainly, even putting aside what the choices have been in terms of fuel loads, today it would have been difficult to beat the McLaren, but I am happy with the overall result for the team.
[20] Heidfeld originally qualified sixth, but was penalised three positions for impeding Red Bull driver David Coulthard in the first session.
[20] As a result, Toro Rosso driver Sebastian Vettel inherited sixth position, ahead of Trulli and Bourdais.
Kubica's eleventh placing was his worst qualifying result to that point in the season, struggling with his car's set-up throughout his two sessions.
[20] Rubens Barrichello of Honda took 13th behind Timo Glock of Toyota, to reach the top 15 for the first time in ten races.
[22] Coulthard failed to move beyond the first session; the Red Bull driver qualified in 15th and blamed Heidfeld for his poor performance.
[20] Kazuki Nakajima of Williams, Jenson Button of Honda and the Force Indias of Adrian Sutil and Giancarlo Fisichella would line up on the back two rows of the grid.
[28] However, Alonso pushed Kovalainen hard through the middle sector of the lap, and passed him at the turn 14 hairpin after drafting the McLaren along the back straight.
[27] Heidfeld was able to move from ninth on the grid to take sixth, after Bourdais drove into the back of Trulli at the first corner.
[3] In the other McLaren, Kovalainen was struggling, running two seconds a lap slower than Hamilton, and dropping back from Alonso to Heidfeld.
[30] Webber had passed Barrichello and Piquet in separate manoeuvres to take ninth, but his pit stop dropped him back down to 18th position.
[30] Kovalainen took the lead of the Grand Prix when Hamilton and Räikkönen paused their battle to take harder tyres and fuel on lap 15.
The Toro Rosso driver passed Sutil (who later spun out and retired with a gearbox problem),[29] Nakajima and Coulthard, to sit in 15th by lap 30.
[27] The gap between the Ferraris began to close, and Massa eased past Räikkönen on the back straight on lap 49, to take second place on the track.
[28] Meanwhile, Kovalainen parked his car in the McLaren garage and retired from the race, his team not taking any chances with a problem which had developed with the engine's hydraulics.
[32] Vettel, Coulthard, Barrichello and Nakajima took the next four places; Bourdais recovered from his early contact with Trulli to take 13th.
The top three finishers appeared on the podium and in the subsequent press conference, where Hamilton praised his team: "they have done a phenomenal job and the car is really a dream to drive.
"[33] Looking ahead to the next race in Brazil, where Hamilton would enter with a seven-point advantage, the Championship leader seemed confident: "It will be tough and [Ferrari] will be pushing us hard but hopefully as a team we can pull through.
"[33] Massa admitted that McLaren had the stronger car on the day: For us we were completely driving on the limit trying to reduce the gap but it was not possible.
"[33] Since the 2002 Austrian Grand Prix, where Barrichello ceded the lead to Michael Schumacher, team orders have been banned in Formula One.
[34] At his first pit stop his team, not realising the cause of the problem, had adjusted his front wing to compensate for the understeer and replaced the tyres correctly.
The BMW driver said his focus would now be on getting as good a result as possible in Brazil, saying "There is now one race left, and I shall try hard to defend my third place.