Miller, who did two qualifying laps on wets before returning to the pits and asking for slicks, was the first independent Ducati rider to take a pole position in the top-flight.
"It wasn't me. I was just hanging on," said the Australian of his performance.
"I was a passenger. When you're on wet with slick tyres... you've just got to hang on and hope to God you make it to the other side."
Honda's Spanish veteran Dani Pedrosa was second fastest, 0.177 slower than Miller's time of one minute 47.153 seconds, with Frenchman Johann Zarco a close third for the non-works Tech3 Yamaha team.
Reigning champion Marc Marquez, Pedrosa's team mate and the race favourite, will start in sixth place while Ducati's championship leader Andrea Dovizioso qualified eighth.
"I decided to try the slick tyres but it was too risky," said Marquez. "As soon as I exited the pit I realised that if I touched the wet side of the track the risk of crashing was great.
"It's a pity we're not on the front row but I'm happy because I think we've worked well this weekend."
(Reporting by Alan Baldwin in London, editing by Christian Radnedge)
