Lionel Messi scored a hat-trick as the hosts fell apart after Ivan Rakitic’s opener, a result of a goalkeeper error.
Diego Llorente was sent off in between two Messi goals before Manucho replied.
Manuel Iturra then saw red but Luis Suarez had the resulting penalty saved as Messi wrapped up a 35th Barca treble before Arda Turan completed the rout.
It was the Turkish midfielder’s first Barcelona goal since his move from Atletico Madrid last summer, but in an action-packed game, it was relegated to a mere footnote.
Luis Enrique’s team now sit eight points clear of second-placed Atletico and they could have easily made it even more convincing against Rayo, who are now separated from the relegation zone by goal difference.
Barcelona twice hit the woodwork with Neymar’s free-kick against the bar falling to Sergio Busquets, who was brought down for Rayo’s second red card and a penalty.
Rayo goalkeeper Juan Carlos Martin Corral made up for his earlier mistake by saving Suarez’s spot-kick with Barcelona now having missed half of their 18 penalties this season. That also includes the one taken by Messi when he passed to Suarez.
The hosts will argue that Llorente’s dismissal was harsh as he took the ball despite a high tackle on Rakitic, but they were outclassed as Messi drew level with Real Madrid’s Spanish record-holder Cristiano Ronaldo on 35 hat-tricks.
The Argentine also took his season’s tally to 33 goals.