Real Madrid and FC Barcelona continued their duel for the La Liga title as both sides won their respective matches.
The first half saw Rayo take the game to their big-spending neighbours and had it not been for a couple of smart saves from goalkeeper Iker Casillas, the home side would have been ahead at the break.
Coach Carlo Ancelotti decided to play winger Gareth Bale along with forward James Rodriguez leaving midfielder Isco on the bench, but in the first half his side were second best.
They took the game to Rayo in the second half however and striker Cristiano Ronaldo scored put them ahead with a diving header 20 minutes from time following a fine cross from defender Dani Carvajal. It was his 300th goal for the club in 288 games.
James then doubled Madrid’s lead 16 minutes from time with a well-placed shot from the edge of the penalty area.
Another factor on the night were the yellow cards shown to Rodriguez and Ronaldo, who will miss Saturday’s game at home to Eibar through suspension.
Earlier in the night Barcelona had assured they would end the day four points clear at the top of the table with a 4-0 win at home to Almeria.
Although the Catalans were not at their best striker Lionel Messi opened the scoring with a curling shot just after the half hour.
Forward Luis Suarez doubled Barcelona’s lead 10 minutes after the break and netted a second with the last kick of the game after defender Mark Bartra had headed a third with 15 minutes remaining.
In another match, Deportivo la Coruna and Cordoba drew 1-1. Cordoba ended their nine game losing streak thanks to a goal from Florin And one after 55 minutes and would have won but for the same player scoring an own goal with three minutes remaining.
Meanwhile, Granada were held to a 1-1 by Celta Vigo in their Los Carmines Stadium.