India, who resumed the day on 329-6, lost an early wicket but overnight batsman Pandya, playing just his third Test, kept up the lower-order fight with his 96-ball 108.
Pandya finally succumbed to spinner Lakshan Sandakan on the third ball of the second session as India's innings ended without adding to the lunch total.
The left-arm unorthodox bowler recorded his first five-wicket haul in Tests while fellow spinner Malinda Pushpakumara took three wickets.
But the day so far has belonged to Pandya, who built crucial partnerships including a 66-run tenth-wicket stand with Umesh Yadav. Yadav remained unbeaten on three.
Pandya also put on 62 with number nine Kuldeep Yadav to frustrate the Sri Lankan bowling attack.
Sandakan broke the stand by dismissing the left-handed Kuldeep caught behind for 26.
But Pandya, 23, pressed on with the assault even after the fall of the ninth wicket as he took on Pushpakumara, smashing two fours and and three sixes in an over off the left-arm spinner.
A 188-run opening stand between Shikhar Dhawan, who smashed 119, and Lokesh Rahul, who made 85, had paved the way for India's commanding total after the visitors chose to bat first.
India are eyeing a series sweep after taking an unassailable 2-0 lead in Colombo.