For the first time in 31 races, since the Singapore Grand Prix of 2010, championship leader and double world champion Alonso will lead away the field at Silverstone.
The Spaniard is joined on the front row by Mark Webber in his Red Bull, beating the Australian by 0.047 seconds, with Mercedes' Michael Schumacher lining up in third place.
For the Britons, it was a day to forget as Lewis Hamilton qualified eighth for McLaren, with team-mate Jenson Button 18th, with Force India's Paul di Resta 11th.
The rain that began at the start of the opening practice session turned torrential for the beginning of Q2 which had to be red flagged just after the midway point.
It resulted in a 92-minute delay, during which time the fans in the grandstands and even the teams in the pit lane, entertained themselves with the odd Mexican wave.
Good old-fashioned brooms and a couple of road sweepers cleared the danger of the standing water off the circuit, allowing the session to recommence just after 3pm.
At that stage Button was a bystander after missing the cut from Q1, the 32-year-old failing to get his front tyres to work on his McLaren.
It just compounded his horror of a year as he has collected six points from the last five races, and his British Grand Prix especially as he has never finished on the podium in 12 attempts at this track.
Button will now have to conjure a special performance if he is to finally bring an end to that hoodoo after qualifying 18th.
It was sod's law the rain that had held off all morning finally decided to hit the track just as qualifying started.
Initially, the track was only wet enough for intermediate tyres, and although conditions fluctuated, with some dry areas appearing on occasion, Button was nowhere near quick enough.
With three minutes remaining he switched to a fresh set of inters for one final shot and was on course to clamber out of the bottom seven when Marussia's Timo Glock spun on the start-finish line.
With yellow flags in the final sector, Button was forced to slow after setting personal best times in sectors one and two, leaving him above the Caterhams, Marussias and HRTs.
For only the second time this season Vitaly Petrov out-qualified Caterham team-mate Heikki Kovalainen, the duo qualifying 19th and 20th.
Glock qualified 21st, followed by the HRT duo of Pedro de la Rosa and Narain Karthikeyan, with Charles Pic requiring the help of the stewards as the Frenchman finished outside the 107% time.
At the start of the 15-minute Q2, the rain increased in intensity, prompting most drivers to switch to extreme wet tyres, with the exception of Ferrari duo Alonso and Massa on inters.
The time lost in realising their mistake and pitting again for the wets ensured that when they posted a 'quick' lap they were trailing in 15th and 16th when the red flagged intervened.
The delay came to their aid as they both made it into the top 10, although with Lotus' Romain Grosjean spinning late on into the gravel, there is a suggestion Alonso made Q3 with a hot lap under waved yellows, with the stewards likely to investigate.
It was enough to drop di Resta down to 11th, followed by Sauber's Kamui Kobayashi, although he faces a five-place grid penalty for a collision with Massa last time out at the European Grand Prix in Valencia.
Mercedes' Nico Rosberg qualified 13th, followed by the Toro Rosso of Daniel Ricciardo and Williams' Bruno Senna.
Watch: Alonso takes pole at wet Silverstone... More Videos
Jean-Eric Vergne was 16th, but faces a 10-place grid penalty for causing a collision with Kovalainen in Valencia, dropping him to last for the race, with Sauber's Sergio Perez qualifying 17th.
Elsewhere in the top 10, reigning world champion Sebastian Vettel qualified fourth, followed by Massa, Lotus' Kimi Raikkonen and Williams' Pastor Maldonado, with Hamilton also on the fourth row.
On row five it will be Force India's Nico Hulkenberg, with Grosjean 10th as he did not compete in Q3 due to his spin.
Alonso, after claiming the 21st pole of his career, said: "It was tricky conditions for everyone. It was not easy.
"To complete a lap in these conditions was difficult, but I'm happy with pole for the first time in two years, for Ferrari.
"But qualifying is one of the less important this year because things will likely get mixed up in the race."
Webber admitted it was "a very tight session", adding: "It was nip and tuck with Fernando for the pole.
"But ultimately we put a good lap together, and I'm happy with that."
As for Schumacher, he would not mind more wet weather on Sunday as he said: "We look reasonably competitive in wet conditions, either on inters or heavy wets, so rain is welcome.
"I'm very happy with third. It's good for the team, good for the boys."