Massa, taking his first pole for six years, sealed an all-Williams front row along with Bottas. Rosberg was third and Hamilton, who span on his second lap, ended up ninth.
Ferrari’s Fernando Alonso was fourth ahead of Red Bull’s Daniel Ricciardo and McLaren’s Kevin Magnussen.
“I am so happy with what has happened today, with us, our team, it was such a great moment,” said Massa.
“It is a long time since I last had a pole position so for sure we need to concentrate on the race tomorrow. It is a great moment and I am in the best place to be – first place.
“After a long time, I hope this is just the beginning of great possibilities. I hope to be in this position again.
“Williams are back to the top, they are back to fight. I am pleased for me and the team as well.”
Drivers’ championship leader Rosberg admitted that he was surprised by William’s pace in Austria.
“I didn’t expect Williams to be ahead of us, but they did a good job and it did not come together for us,” said Rosberg.
“I could not put the perfect lap together because of Lewis spinning – I had to lift off, so that definitely cost me today. Third is OK to start from – I’ll have a quick car in the race.”
1. Felipe Massa Brazil Williams-Mercedes 1m 08.759s
2. Valtteri Bottas Finland Williams-Mercedes 1m 08.846s
3. Nico Rosberg Germany Mercedes-Mercedes 1m 08.944s
4. Fernando Alonso Spain Ferrari-Ferrari 1m 09.285s
5. Daniel Ricciardo Australia Red Bull-Renault 1m 09.466s
6. Kevin Magnussen Denmark McLaren-Mercedes 1m 09.515s
7. Daniil Kvyat Russia Toro Rosso-Renault 1m 09.619s
8. Kimi Raikkonen Finland Ferrari-Ferrari 1m 10.795s
9. Lewis Hamilton Britain Mercedes-Mercedes No time
10. Nico Hulkenberg Germany Force India-Mercedes No time
11. Sergio Perez Mexico Force India-Mercedes 1m 09.754s
12. Jenson Button Britain McLaren-Mercedes 1m 09.780s
13. Sebastian Vettel Germany Red Bull-Renault 1m 09.801s
14. Pastor Maldonado Venezuela Lotus-Renault 1m 09.939s
15. Jean-Eric Vergne France Toro Rosso-Renault 1m 10.073s
16. Romain Grosjean France Lotus-Renault 1m 10.642s
17. Adrian Sutil Germany Sauber-Ferrari 1m 10.825s
18. Esteban Gutierrez Mexico Sauber-Ferrari 1m 11.349s
19. Jules Bianchi France Marussia-Ferrari 1m 11.412s
20. Kamui Kobayashi Japan Caterham-Renault 1m 11.673s
21. Max Chilton Briton Marussia-Ferrari 1m 11.775s
22. Marcus Ericsson Sweden Caterham-Renault 1m 12.673s
MORE: The latest football news
MORE: The latest tennis news