Fernando Alonso emerged from the chaos in Korea to claim his third victory in four races and move to the top of the Formula One world title standings.
In a rain-hit inaugural Korean Grand Prix, for the first time this season Red Bull suffered a double retirement.
Mark Webber surrendered his championship lead when he crashed out on lap 19, whilst Sebastian Vettel's engine blew nine laps from home when he was on course for the win.
It allowed Ferrari star Alonso to take the chequered flag and move 11 points clear of Webber, with Lewis Hamilton - second on the day - now 21 down on his former McLaren team-mate.
Given the conditions, it was an appreciably chaotic race, one that involved four safety car periods.
Overnight rain that had persisted throughout the morning eventually relented at around midday, only to start falling again 35 minutes before the race was due to commence, growing in intensity as the start drew nearer.
It resulted in the announcement of a 10-minute delay before race director Charlie Whiting then took the decision to start the grand prix behind the safety car.
It was the correct thing to do, although some argued given the vast sums of money the drivers are paid, they should simply have got on with it.
But for three laps behind the safety car a number of drivers expressed their concerns, and it became abundantly clear the conditions were too severe to continue.
It prompted Whiting to red-flag the race, with the drivers lining up in their original grid positions, and wait for the rain to ease.
Overall, we had to wait 48 minutes before it was announced the race would start again behind the safety car, and when it did, it was another 37 minutes before the field was finally unleashed.
Hamilton had been eager to get going as the frustration built in the second safety car stint as he made his feelings clear on three occasions over the in-car radio.
However, almost immediately on the first racing lap - but the 18th overall - the 25-year-old lost his fourth place to Rosberg.
That was shortlived as the first major accident of the day occurred on lap 19 involving Webber and Mercedes' Nico Rosberg.
Webber put his left-front wheel off the track at turn 12, catching the synthetic surface that then sent him spinning into a wall.
The momentum carried him back across the track where Rosberg was unable to take evasive action, colliding into the Australian, with both drivers retiring.
An honest Webber said: "Totally my fault.
"I got on the kerb on the exit of turn 12 and it was a very slow-motion moment off the back of that kerb. Totally my mistake.
"It wasn't my day, and I collected Nico as well.
"Postions are not important, the points are the most important thing.
"This is my second non-finish of the year, but there are still two races to go. I'll do my absolute best."
It resulted in the re-introduction of the safety car, although more pertinently it allowed Alonso to move up to second and Hamilton third.
Further accidents followed involving Lotus' Jarno Trulli and Bruno Senna for Hispania, the former retiring in his garage.
Virgin Racing's Lucas di Grassi spun into a wall, then Sebastien Buemi collided with Virgin's Timo Glock, the Swiss losing his front left wheel, forcing the deployment of the safety car for the fourth time.
It prompted a flurry of pit stops during which Hamilton managed to take second from Alonso due to the Spaniard being delayed, only to lose it again on the resumption as he ran wide into turn one.
With light fading, Vettel then complained he could not see clearly, an unsurprising comment that came after lap 42, the point at which full points could be awarded.
That prompted McLaren to ask Hamilton for his thoughts to which he replied: "It's fine." It was tit for tat.
Then on lap 46, just as Vettel surrendered his lead to Alonso into turn one, the Renault powerplant blew as he gunned the car heading up the long straight out of turn two.
The German, who would have led the championship for the first time this season if he had held on for the win, now finds himself down in fourth, 25 points behind Alonso.
As for reigning champion Jenson Button, his title reign is all but over as he could only manage 12th and trails Alonso by 42 points.
Massa joined team-mate Alonso and Hamilton on the podium, with Michael Schumacher equalling his best finish of the season with fourth in his Mercedes.
Robert Kubica was fifth in his Renault, followed by Force India's Vitantonio Liuzzi, Williams' Rubens Barrichello, the Saubers of Kamui Kobayashi and Nick Heidfeld, and with Toro Rosso's Jaime Alguersuari 10th.
After lifting the winners' trophy and spraying the champagne in the dark, a beaming Alonso said: "I'm absolutely delighted.
"It was one of the best races of the year for us, one in which we have been competitive all weekend.
"We knew it was going to be a tricky race, but it's the first time I've won in the wet, so I'm very happy."
Asked as to his read on the championship with two races remaining, Alonso added: "Nothing changes. With the new points system anything can happen in one race."
With Hamilton still in the championship hunt, he said: "It was a great result that I'm very happy with.
"Fernando did a fantastic job, but he generally had more grip and at the end my tyres were shot, so it was just a case of bringing the car home and trying to score as many points.
"We've now two races left and we have to get some good results."