Two days after Pep Guardiola announced his decision to step down as Barca coach at the end of the season, World Player of the Year Lionel Messi scored two goals and had a hand in four more including two for Pedro.
Barca were playing at Rayo's compact stadium just a short distance away from Plaza de Cibeles in Madrid where everything was in place for the mass festivities expected when Jose Mourinho's side win a first league title in four years.
Real maintained their seven-point lead with three games left after Karim Benzema bagged a double and Cristiano Ronaldo racked up his 43rd league goal of the campaign to crush Sevilla.
Mourinho's side have 91 points and can secure their 32nd league title with victory at Europa League finalists Athletic Bilbao on Wednesday, regardless of what Guardiola's side do at home to Malaga.
"We won this game which was very important and now we'll carry on so we can close out the league title," Benzema told Spanish television as Mourinho continued his domestic media blackout.
"The Champions League is finished so now we need to make sure we win the next most important competition," added the France international.
Big-spending Malaga strengthened their chances of a first venture into the Champions League next season when a cross looped in off Ignacio Camacho's shoulder for a 1-0 home win over Valencia.
The visitors, dumped out of the Europa League on Thursday, had midfielder Sofiane Feghouli sent off in the 61st minute, and Manuel Pellegrini's side drew level with them on 55 points.
Valencia stayed third, ahead of Malaga due to their superior head-to-head record, in the last two qualification slots for Europe's elite club competition.
Elsewhere, Radamel Falcao grabbed a late equaliser for Europa League finalists Atletico Madrid to draw 2-2 at Real Betis.
Diego Simeone's side were sixth with 49 points, one ahead of next month's final rivals Bilbao in seventh who lost 2-0 at struggling Real Zaragoza.
Ronaldo's 19th-minute opener at the Bernabeu, scene of Real's dramatic penalty shootout defeat by Bayern Munich in the Champions League on Wednesday, was his 57th in all competitions this season and 43rd in the league.
Benzema made it 3-0 with goals in the 48th and 52nd minutes as Sevilla were swatted aside. The Andalusians are ninth on 46 points and in danger of missing out on a lucrative place in Europe next season.
Benzema's brace took his league tally for the campaign to 20 and with strike partner Gonzalo Higuain on 21 it is the first time three players from one club have scored 20 or more goals in a La Liga season. Their combined total of 84 is 30 more than third-placed Valencia's total.
Barca were quickly back into their stride after their shock Champions League defeat by Chelsea, making the most of the spaces left by attack-minded Rayo.
Pedro crossed low for Messi to score and the Argentine won the ball to start the counter for the second.
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.