After coming out of Pain's Chibaku Tensei, Naruto first snatched a chakra receiver from the Deva Path, and stabbed himself momentarily to track down Nagato's location using his Sage Mode.
He then created two shadow clones and then a Rasenshuriken using these clones. He also used two smoke bombs for deception. He had already used this trick previously during the battle, when he had first sent a real Rasenshuriken and then his real self disguised as a Rasenshuriken.
Pain began anticipating the same thing to happen. As expected, Naruto sent the first real Rasenshuriken, which pain promptly deflected using Shinra Tensei. However, this time, the second Rasenshuriken was a real one, hidden under the first one as a shadow shuriken. Naruto's two shadow clones also emerged, but Pain was prepared having already seen this trick before (or so he thought). He stabbed the two clones with his chakra receivers, and also dodged the Rasenshuriken.
The purpose of this part of Naruto's plan was to force Pain to use Shinra Tensei, to take advantage of the five second interval during the next part of his plan. It is now revealed that Naruto had previously used the Mass Shadow Clone technique, and then transformed those multiple clones into boulders. Naruto undoes the transformation, aiming to attack Pain with these shadow clones.
However, this doesn't work as expected since Pain's ability returns at the last moment, and he uses the Shinra Tensei to push away Naruto's shadow clones before he can land a direct hit on Pain.
Now Naruto switches to a backup plan, wherein he uses the mass shadow clones as a support for the main body to oppose Shinra Tensei's push. Having used the Shinra Tensei, Pain's five second interval kicks in again, during which Naruto finally lands a direct hit on Pain using his Rasengan. Having defeated the Deva Path, he proceeds to meet the original Nagato.