First-half goals from Lee McCulloch and Nicky Law put Rangers in command before Martin Scott replied for Raith, who went into the game unbeaten away from home in the league.
However, the Gers hit straight back with goals from Kenny Miller and Kris Boyd before Jon Daly’s late double completed the rout.
McCulloch opened the scoring in the eighth minute with a glancing, near-post header from Lewis Macleod’s corner.
The home side then piled on the pressure with Boyd and Law both seeing shots saved by Ross Laidlaw in the visitors’ goal, while Fraser Aird flashed a shot wide.
However, Paul Watson missed a free header for the visitors before Law made it 2-0 in the 36th minute with a neat chip over the onrushing Laidlaw after he was played in by Miller following Boyd’s quick free-kick.
Macleod fired just wide before the break, but Raith were back in the game in the 54th minute when Scott netted from Grant Anderson’s nod-back.
Rangers restored their two-goal advatage just a minute later, though, thanks to an angled drive from Miller after he was teed up by Boyd.
Boyd got his name on the scoresheet and ended his seven-game drought, in the 63rd minute with a left-footed strike from just outside the box, although Laidlaw had a nightmare and should have realy have saved it.
The 31-year-old was replaced by Daly in the 71st minute and the substitute helped himself to two goals in the final 10 minutes – both from close range from Richard Foster assists – to wrap up the victory.