New signing Keatings, making his first league start, hit his first goals for the club as the Jambos maintained their 100 per cent record in the Scottish Championship.
The ball broke to the striker inside the area after 12 minutes and he slotted into the bottom corner to break his duck.
Hearts' second came in the 28th minute as Keatings beat two men before firing home from outside the area.
Keatings completed his hat-trick just before the hour as the youngster curled a free-kick into the top-left corner to cap a dream day.
Raith had chances, but a miserable afternoon was sealed as the game entered injury time, with substitute Gary Oliver finishing from close range after a blocked shot dropped kindly at his feet.