Ronaldo backheel helps Real defeat Rayo
The Portuguese international pounced on a loose ball at a 54th-minute corner and sent it through a crowd of players into the net for his 29th goal of the season, two ahead of Barca forward Lionel Messi at the top of the scoring chart.
Real's victory at promoted Rayo's sun-drenched stadium in the south east of the Spanish capital put Jose Mourinho's side 13 points clear of second-placed Barcelona ahead of the champions' game at Atletico Madrid.
Mid-table Rayo, hosting their more illustrious neighbours for the first time in nine years, had the best chance of the first half when forward Piti crashed an angled shot past Iker Casillas that hit the inside of a post and bounced away along the line.
Real were missing winger Angel di Maria and striker Karim Benzema, both injured, and struggled to create chances against a resolute Rayo, who were coming into the game on a run of three consecutive wins and were roared on by their flag-waving faithful enjoying the warm weather.
They made Real suffer in the closing stages and squandered three clear chances for an equaliser, first when Sergio Ramos gave the ball away in a dangerous position.
It eventually fell to Michu but he skewed his shot over the bar before Casillas was forced into a superb diving save that stopped a thunderous long-range strike from Jose Manuel Casado.
Michu was shown a straight red card two minutes from time for a relatively innocuous-looking tackle from behind on Real's Germany midfielder Sami Khedira and Rayo forward Emiliano Armenteros somehow failed to score when the ball fell to him on the line with Casillas stranded.
In an entertaining match earlier on Sunday, Athletic Bilbao missed a chance to climb above Levante into fourth and a Champions League qualification place when they were held to a 2-2 draw at improving Villarreal.
The home side, whose season has been wrecked by injuries to key players, took a 10th-minute lead through former Spain midfielder Marcos Senna before goals from Fernando Llorente and Markel Susaeta put the Basque club 2-1 ahead.
Nilmar equalised in the 68th minute to leave Villarreal in 17th on 27 points and Bilbao in fifth on 34, one behind Levante, who won 2-1 at seventh-placed Espanyol on Saturday.