Earlier, Lionel Messi and Luis Suarez were on target as Barca eased past Almeria 4-0.
Barca took over half an hour to make the breakthrough, but Messi did so in style as he curled home his 44th goal of the season into the far corner.
Suarez made the game safe when he fired into the top corner 10 minutes after the break and bagged his second of the evening in stoppage time after Marc Bartra headed home the third from Xavi’s corner.
“It is the stage of the season where we have a lot to play for,” said Suarez.
“We ought to show our personality because we are Barcelona.
“In the league we depend on ourselves and we need to continue in this vein.”
Madrid endured a much more uncomfortable evening in a capital derby at Rayo before Ronaldo and James Rodriguez struck midway through the second-half.
“We suffered, but in the end we won which is the most important thing,” said Rodriguez, who again impressed in just his second game back after two months out with a foot injury.
“In the first-half they were intense, we knew that in the second they would get a bit tired and not be able to pressure so much and it was like that.”
Rayo dominated the first period in terms of possession, but it was still Madrid who had the better chances as Rodriguez shot straight at Diego Cobeno when unmarked inside the area before Ronaldo headed over from the Colombian’s free-kick.
At the other end, Iker Casillas made a fine save to keep the visitors level at the break as he parried Roberto Trashorras’s back post header to safety.
Madrid started much stronger after the break and were inches away from an opener when Gareth Bale’s header from Rodriguez’s cross looped just wide.
There was then a huge moment of controversy when Ronaldo was booked despite appearing to be clearly brought down by Antonio Amaya inside the area meaning he will miss Saturday’s visit of Eibar to the Santiago Bernabeu.
The chances continued to come and go for Real as Benzema, Marcelo and Bale fired just off target in a matter of minutes, and the goal finally arrived when a fine run and cross from Dani Carvajal picked out Ronaldo and he sealed his triple century of goals for Madrid in just 288 games.
Six minutes later it was 2-0 as Ronaldo turned provider this time for Rodriguez to curl home.
However, Messi opened the scoring in brilliant fashion when he found space on the edge of the area and curled into the far corner with pinpoint accuracy.
Suarez made sure of Barca’s 20th win in their last 21 games in all competitions with a little help from Cuesta the keeper got a hand to the Uruguayan’s powerful effort but couldn’t keep it out.
A consistent feature of that run has been the Catalans sudden ability to score from set-pieces and they did so for the third consecutive game 15 minutes from time when Bartra rose highest to power home Xavi’s in-swinging delivery.
And Suarez was gifted his second when Pedro Rodriguez unselfishly picked out the former Liverpool man to roll into an empty net.
At the other end of the table Deportivo la Coruna sacked manager Victor Fernandez after Cordoba ended a 10-game losing streak with a 1-1 draw against the Galicians at La Riazor.
Granada’s survival hopes also suffered a huge blew as Theo Bongonda struck a 93rd minute equaliser for Celta Vigo to secure a 1-1 draw at Nuevo Los Carmenes.