The Liga giants had their three-prong attack to thank as they secured an important victory over Jose Ramon Sandoval's men to move closer to Real Madrid at the top of La Liga
An impressive double from Alexis Sanchez gave Pep Guardiola's side the lead before David Villa found the back of the net just before half-time. Lionel Messi added a fourth four minutes after the re-start to secure the win as Real Madrid's lead was cut to three points, with Jose Mourinho's men having a game in hand to play.
The victory also ensured it was the 11 Liga game at Camp Nou where the Catalan club had kept a clean sheet, a new record in Spain.
After a frantic opening the home side came close to opening the scoring as early as the second minute. Andres Iniesta spotted Davis Cobeno off his line and the midfielder's audacious effort from 40 metres out had the goalkeeper backtracking, who eventually had to dive at full stretch to turn the ball around the post for a corner.
Despite not being at their flowing best, Guardiola's men took the lead in the 29th minute through a moment of magic from Sanchez. The Chilean received the ball from a Xavi pass on the left-hand side of the box before cutting in and curling a delightful effort into the far top corner for his second Liga goal of the season.
On 41 minutes, the home side doubled their lead and it was Sanchez again who found the back of the net, via an inadvertent piece of delicious skill from Xavi. Lionel Messi's clever through ball found the 31-year-old midfielder who flicked the ball with his heel into the path of Sanchez to sweep home from 12 yards out.
Two minutes later the champions added a third to put the result beyond doubt before the half-time whistle had been blown. Gerard Pique's barnstorming run into the Rayo final third saw the former Manchester United defender slide the ball to Alves who then squared it to David Villa who placed the ball into an empty net from close range.
The home team made it four on 49 minutes with Lionel Messi grabbing his 16th Liga goal of the season. The Argentine controlled Alves' pass on the right wing before pacing past Javi Fuego and sliding the ball past Cobeno from a narrow angle.
Villa nearly made it five in the 70th minute when he controlled a long ball before attempting to life the ball over the onrushing Cobeno from 20 metres out. However his effort narrowly looped over the crossbar as the home team comfortably saw out the win.
Barcelona are back in Liga action on Saturday where they will be hoping for another three points away against this season's surprise package, Levante. Rayo Vallecano visit local rivals, Atletico Madrid the next day.