Toni Kroos put the finishing touch on a fine move for the opener in the 14th minute, with Karim Benzema's second later proving decisive.
Radamel Falcao headed home for Rayo but they could not find the second goal they needed to take something from the game.
Real coach Carlo Ancelotti later said: "I saw a team who played very well for 80 minutes. We had loads of chances and I thought we'd have to get another goal to kill the game off.
"The third goal never came and when they scored, we had ten minutes of fear and we suffered for it, but we have to look at the big picture. It's unusual for Karim to miss the chances we had today. I'm pleased because Rayo play some good stuff and press well".
"We got around the press and found good options up top, as well as countering well. If the game had finished with 80 minutes on the clock, we could have said it was our best performance of the season, but we were unable to convert the chances we had and then we conceded the goal. From that point on we couldn't take risks in our play. They waited for us to lose the ball to play on the counter."
Need a VPN? Or seeking to switch? Then support Tribal Football by clicking here to sign up with our official partners NordVPN. Not only will you receive the best VPN experience, but also great discounts by signing up via Tribal Football. Thanks for your support!