Real survive Ramos red to see off Rayo
Youth team striker Alvaro Morata and Ramos scored inside the opening 12 minutes, but Real were checked when their captain picked up two yellow cards in quick succession to get sent off.
The third-placed champions moved on to 49 points from 24 games, four behind second-placed Atletico Madrid, who remembered how to win on the road again when Radamel Falcao opened the scoring in a 3-0 victory at Real Valladolid.
Barcelona are top with 65 points after a 2-1 victory at Granada on Saturday in which Lionel Messi scored both goals.
After a draining midweek Champions League clash with Manchester United which ended 1-1 at the Bernabeu, Real coach Jose Mourinho, in his 100th league game in charge, rang the changes.
Xabi Alonso was rested and with Gonzalo Higuain, Luka Modric and Alvaro Arbeloa suspended, Morata was given his first league start up front and Kaka a rare run out in midfield.
The match was only three minutes old when Mesut Ozil's low cross found Morata in the area and the 20-year-old fired in the opener.
Real threatened to run riot as Ramos rose to head the second from an Ozil free kick in the 12th.
However, Rayo were let off the hook when Ramos collected two quick yellow cards, first for bundling over a player and the second for a handball after 18 minutes, the 26-year-old Spain defender's 17th red card of his professional career.
"It was a shame because it started so well for the fans," Real director Emilio Butragueno told Spanish television.
"It was difficult to see so it is best not to comment on the referee's decision. The important thing is we won."
Rayo battled but although they took the game to Real they were given little room by an organised Madrid defence.
Atletico last won on the road in mid-November, when they defeated Granada 1-0, but after consecutive defeats in La Liga and the Europa League they rediscovered their bite to turn over Valladolid.
Colombia striker Falcao pounced on a loose ball to score after Diego Godin's volley at a free-kick was only parried in the 11th minute. It was his 20th league goal of the season.
Atletico's recent wobble looked to be behind them as they were first to everything and Brazilian striker Diego Costa doubled the lead in the 53rd minute after latching on to a cushioned header from midfielder Koke.
Uruguay winger Cristian Rodriguez grabbed a third at the end when he sneaked in to profit from a poor pass back to the goalkeeper.
"It was one of our best games of the season," Atletico coach Diego Simeone told reporters. "We were solid, aggressive and intense and the result was never in doubt."
Earlier, a towering header from Ricardo Costa and a late strike from Roberto Soldado earned 10-man Valencia a 2-0 home win over struggling