The hosts took the lead through Karim Benzema after just 13 minutes, but they failed to build on that and produced a laboured display against a team they scored 10 past the last time the fixture was played at the Bernabeu.
Indeed, Madrid needed a double save from Thibaut Courtois in stoppage time to secure the points as they closed the gap on leaders Barcelona to two points.
Find out how all of the action unfolded courtesy of Sports Mole's minute-by-minute updates below.
The hosts come into this match off the back of a shocking result in midweek, but today they are hosting a team struggling to make their mark on the top flight following their promotion last season.
We will have a closer look at both sides a little later, but first let's check out the team news...
Well, the first thing to note is that Gareth Bale misses out for Madrid after picking up an ankle injury against CSKA in midweek, forcing him out of the squad entirely for this one after he failed a late fitness test.
The Welshman has not been in the best form for Madrid so far this season, but his absence is still a major blow considering he has scored six goals in his last two games against Rayo.
Those include Dani Carvajal, Sergio Ramos and Raphael Varane in defence, while Toni Kroos is also back in the starting XI having made his return from a knee injury as a sub against the Moscow outfit.
One notable absentee from the starting lineup is Isco, who was booed by his own supporters against CSKA on Wednesday night. There has been speculation that he is pushing for a move away in January, and his relationship with the fans appears to have completely broken down now.
Marcelo and goalkeeper Thibaut Courtois are the only players to keep their places in the defensive areas, while Llorente, Asensio and Benzema continue in the side in the forward and midfield areas.
There is no doubt that they have missed Ronaldo's goals so far - as is only natural - but they need others to step up too. Sergio Ramos is second in Madrid's leading scorer list on four, alongside Bale.
The loanee from Madrid has netted for league goals for the struggling visitors this season and his absence will be a big miss for Rayo in their attempts to spring a surprise today.
Amat and Kakuta have both enjoyed spells in English football, of course, and there is another former Premier League player in Rayo's ranks with Giannelli Imbula - on loan from Stoke - being handed a start in midfield today.
The other switch sees Madran come into the side as Amat, Trejo and Pozo - the latter of whom is his side's second-highest scorer with two goals - drop out of the starting XI.
The European champions have endured a dreadful start to the season, and yet still go into this weekend sitting fourth in the table and with the prospect of moving to within two points of the leaders.
Eight victories from those 15 games have ensured that they are not out of the title race just yet, though, and another win today would close the gap to only two points before Barcelona face Levante tomorrow.
In fairness to Santiago Solari, he has managed to steady the ship with eight wins from his 10 matches at the helm across all competitions, but they are still prone to a shock and the two matches he has failed to win have resulted in chastening defeats.
Madrid, to their credit, had already won the group and sealed their place in the last 16, but it was still an embarrassing result for the club and not the first time that they have been soundly beaten this season.
Madrid have now lost seven of their last 18 games too, including those 3-0 defeats to Eibar and CSKA under Solari.
Madrid scraped past basement club Huesca last weekend thanks to Bale's early strike, but their midweek defeat means that they are in danger of losing successive home games for the first time since April 2011.
Only Atletico Madrid and Barcelona have picked up more points in front of their own fans, while Madrid have also conceded only three goals at the Bernabeu, which is the lowest tally of any home ground in the division.
The problem is their own form, though, with Michel's side having struggled since their promotion back to the top flight so far. As things stand, an immediate return to the Segunda Division is looking likely.
Today's visitors have only won two of those 15 games, but there have been signs that they are capable of picking up points on a more regular basis as the season progresses and a couple of wins here or there could lift them into a position of safety.
Only three teams have scored fewer than them too, with Rayo averaging one goal per game so far, and they have a remarkably bad record here at the Bernabeu too, so this is not a trip they will have been looking forward to.
That victory came at the end of last month, but since then Rayo have lost both of their games without scoring - against Leganes in the Copa del Rey and then against Real Betis last Saturday.
They have not even lost back-to-back league games since the beginning of November, so while plenty of points are being dropped with draws, Rayo are not quite as easy to beat as their lowly league position might suggest.
Barcelona struggled against today's visitors too, to the extent that they needed goals in the 87th and 90th minutes to turn what would have been a costly 2-1 defeat into a 3-2 victory, so Madrid will not be expecting a walkover today.
Indeed, no team has picked up fewer away points in La Liga this term, with their solitary triumph coming at fellow strugglers Huesca, while they have also scored the joint-fewest away goals too.
That Huesca defeat is actually Rayo's only La Liga away win in their last 24 attempts stretching back to their last spell in the top flight, while the last four have all ended in defeat.
Real Madrid have been prone to the odd unexpected result this season, but surely they must pick up all three points from this one. Rayo are not an easy team to beat, but they have been poor on the road and everything points towards a home win here.
SPORTS MOLE SAYS: Real Madrid 3-0 Rayo
Indeed, the last time Rayo were in La Liga they lost both matches against Madrid by a remarkable aggregate scoreline of 13-4, despite leading in both games.
Real have now won each of the last 16 meetings between the two sides stretching back to a goalless draw in March 2000, while it is 21 years since Rayo last beat Los Blancos.
That average only drops a little when you extend the record further, with Madrid scoring 28 times in their last five home editions of this fixture. Will we see another goal-fest today?
REAL MADRID STARTING XI: Courtois; Carvajal, Ramos, Varane, Marcelo; Kroos, Llorente, Modric; Vazquez, Benzema, Asensio
RAYO VALLECANO STARTING XI: Dimitrievski; Tito, Galvez, Velazquez, Moreno; Advincula, Imbula, Santi, Medran; Alvaro, Embarba
The striker begins the move himself with a sweeping pass out wide for Vazquez. He continues his run into the box and latches on to Vazquez's pass before whipping his finish into the bottom far corner.
There was a really open period after the opening goal when both sides squandered chances to add to the scoring, but it is Madrid who have dominated for the most part and they certainly deserve their lead.
It was a confident finish from the French striker, who began the move himself, and at that stage it looked certain that we would see another goal before the break. However, it remains that Benzema goal which separates the two sides.
However, Rayo could well be on the scoresheet themselves having seen Velazquez miss a couple of headed chances from set pieces. The best of those saw him glance his finish narrowly wide, having attacked the ball really well inside the area.
Madrid will know that Rayo can be dangerous going forward and that they can be shaky at the back themselves, though, so a second goal would be very welcome for the hosts.
Fans greet full time with whistles as the hosts are forced to survive a late scare en route to a narrow 1-0 victory over relegation-threatened Rayo, courtesy of Karim Benzema's first-half goal. Not convincing at all, but they are up to third and remarkably only two points off top now.
Thank you very much for joining Sports Mole for today's La Liga clash as Real Madrid scrape past struggling Rayo Vallecano at the Bernabeu. I will leave you with our match report, and be sure to stick around for reaction too.
From me, though, it is goodbye for now!