The pair traded fastest times in the final 10 minutes of a dry second session, before Stoner (Honda) eventually settled the issue with a 1m38.396s - putting him more than three tenths clear of the field.
Spies did enough to claim second, in the process outpacing his Yamaha stable-mate Jorge Lorenzo for the first time this year.
The pair were separated by Tech 3 Yamaha's Cal Crutchlow and the second works Honda of Dani Pedrosa.
Alvaro Bautista put his satellite Gresini Honda sixth, ahead of the two works Ducatis and Hector Barbera's satellite Pramac entry.
Of the trio it was Hayden who emerged on top, with Barbera pipping Rossi to eighth late on.
Rossi finished just over three tenths down on Hayden, but was within 1s of Stoner.
Andrea Dovizioso on the second Tech 3 Yamaha ended 10th, while Aspar's Randy de Puniet was once again the fastest CRT rider in 13th.