Barca suffered their first loss of the campaign when they went down 1-0 on Saturday to slip six points behind leaders Real Madrid but after a shaky opening at the Nou Camp they crushed their valiant visitors.
Chile forward Alexis broke the deadlock in the 29th minute, and added a second in the 41st before forward David Villa made it 3-0 before the break.
Lionel Messi raced in off the right flank to notch his 16th league goal of the season after the restart.
The match was brought forward due to Barca's participation in the Club World Cup in Japan next month and saw them climb to 31 points from 14 games, three behind Real who a game in hand.
"Alexis isn't only a forward, he also does a job which helps the team a lot," Barca coach Pep Guardiola told reporters.
"He picked up an injury (a hamstring tear which kept him out for two months), but before this he had been immense. You can see he just lacks the things that only time and regular play can bring. I have to congratulate him for his game."
Rayo surprised Barca with an adventurous game plan, pressuring the hosts deep in their own half, and successfully unsettled Guardiola's side but failed to take their chances.
Alexis, who Barca signed in July for a fee that could rise to 38 million euros, lifted his side with a superb individual goal, curling a shot in off the far post to settle home nerves.
He then pounced on a loose ball to double the advantage before Gerard Pique surged out of defence to set in motion the move which ended with Villa slotting in the third.
Alexis, Villa and Pique have all been under the spotlight in recent weeks as Barca have failed to really shine and will need to be at their best on December 10 when they visit Real Madrid for the first league 'clasico' of the season at the Bernabeu.
World Player of the Year Messi wrapped up the scoring in the 49th minute as Barca enjoyed a La Liga record 11th consecutive game without conceding a goal at home - a run stretching back to April when Almeria scored in their 3-1 defeat.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.