The first shot on target came from the visitors after nine minutes when Clayton Donaldson brought a great save out of Adam Collin.
But four minutes later Rotherham were in front. James Tavernier skipped round Alan Judge and was brought down, leaving Kieran Agard to calmly convert from the resulting spot kick.
The home side continued to dominate with Ben Pringle firing narrowly over, while Alex Revell headed off target and Tavernier smashed a free-kick against the post.
The Millers doubled their lead a minute before the break. A brilliant passing move down the left involving four players ended with Pringle squaring the ball across the edge of the area for Agard to slam home his 20th goal of the season.
Livewire Agard almost completed his hat-trick after 59 minutes, but headed just over the crossbar before Lee Frecklington saw a great curling shot go wide of the upright after 73 minutes.
Substitute Harris Vuckic neatly added the third goal in added time one minute after stepping off the bench to complete the rout, and cut the gap to the second placed visitors to seven points.