The league leaders continued to dominate as Alim Ozturk attempted to rifle the ball in from 25 yards out, but his effort was blocked, while McGurn was ready again to turn another effort from Keatings behind as he tried to drive it in low from close range.
While Keatings continued to see his own efforts blocked, the striker was involved in the opening goal as he crossed the ball in low for Kevin McHattie, leaving his teammate with a simple tap-in from just a few inches out.
The visitors could have doubled their advantage shortly after when Genero Zeefuik attempted to fire in from the edge of the box, but his finish was high.
The hosts started to see more of the ball as half time approached, but Ryan Conroy hurried his effort from 20 yard out, sending his strike high and wide.
Conroy made amends just a few minutes later though, picking out Craig Barr with a well-placed cross to set the defender up for a header into the top corner.
Hearts were on the attack early in the second half as they attempted to restore their advantage, but McGurn continued to frustrate the visitors, denying Zeefuik and Ozturk in the space of three minutes.
Rovers almost forced a lead with just over an hour played when Lewis Vaughan created some space in the middle to allow him to unleash a rasping effort from 25 yards out, but Neil Alexander watched it all the way to make the stop.
The home side's hopes of causing an upset were dealt a blow five minutes later when Christian Nade went in hard on McHattie, earning himself a red card for the challenge.
Hearts quickly tried to capitalise on their man advantage, but Sam Nicholson had two efforts saved in just over a minute, the second of which forced a quick reaction from McGurn.
The visitors did manage to head back in front with just over 10 minutes to play when Morgaro Gomis played a high ball forward for Jamie Walker, who unleashed a powerful drive from just outside the area, slotting it into the bottom corner.
The table toppers put the result beyond doubt with five minutes to play when Walker found himself in a strong position again, but this time he squared it to King, who smashed it into the back of the net.
Conroy came close to pulling one back for the home side late on, but his low strike was just held by Alexander.
The result moves Hearts 20 points clear of Hibernian, while Raith stay sixth in the table.