Two goals in as many minutes midway through the first-half killed the game as a contest as Ivan Rakitic and Messi netted before Diego Llorente saw a straight red card for a high challenge on Rakitic yesterday.
Messi completed his hat-trick either side of Manucho's consolation for Rayo.
Luis Suarez also missed a penalty after Manuel Iturra was also sent-off for the hosts before Arda Turan rounded off the scoring with his first Barca goal.
"We played very well and when we are at this level in terms of attitude and intensity, it is very hard for the opponents," said Barca boss Luis Enrique.
More From This Section
Rayo were unbeaten in their seven league games themselves and forced Barca 'keeper Claudio Bravo into a smart early save as the Chilean international flew to his right to turn away Adrian Embarba's drive.
However, Rayo's high defensive line was offering plenty of encouragement to the European champions and it seemed only a matter of time before Barca took advantage as Carlos made a good save at his near post to deny Messi.
The visitors' second two minutes later was straight out of the Barca textbook, though, as a brilliant one-two between Neymar and Messi freed the Argentine to slot home from close range.
Llorente let Rayo's frustration boil over three minutes before the break when he lunged in studs up on Rakitic and was rightly shown a straight red card.
Messi piled on further punishment for the hosts when he casually rolled the ball home after Suarez had smashed against the post soon after the restart.
Messi passed up the chance to seal his hat-trick to help Suarez in his battle with Cristiano Ronaldo to be La Liga's top scorer.
However, Barca's awful record from the spot this season continued as Carlos made amends for his earlier error with a fine save.
The five-time World Player of the Year had to wait just three minutes more to get his third of the night as Messi sauntered through on goal before slotting past the advancing Carlos.
And Turan rounded off a perfect evening for Luis Enrique's men when he headed home from Jeremy Mathieu's cross five minutes from time.
Real Betis also eased their relegation fears as they took advantage of an Espanyol side ravaged by gastroenteritis to win 3-0.