Tottenham loanee Iago Falque broke the deadlock midway through the first half with a fine individual goal and a deflected effort by Anaitz Arbilla just a minute later doubled the hosts' advantage.
Joaquin Larrivey slotted in a penalty on 45 minutes and Sergio Sanchez was given a second yellow card for conceding the spot-kick.
Rayo then coasted to victory, Falque scoring another impressive goal but Ukrainian forward Oleksandr Iakovenko got a late consolation for Bernd Schuster's side.
Rayo move to within two points of safety but have to wait and see how their fellow strugglers get on later this weekend, while Malaga suffered another setback in their bid to secure survival as soon as possible, and are just four points from the bottom three.
Rayo forward Alberto Bueno had the first attempt of the game after just 40 seconds, playing a one-two with Larrivey but failing to test Willy Caballero. At the other end Pedro Morales unleashed a volley but Rayo goalkeeper Ruben was able to get a hand to it.
The game had been evenly matched although Rayo had shown more attacking ambition. They went ahead through a fantastic individual effort by Falque, who rushed down the right wing, beating two defenders with a turn and a nutmeg before knocking the ball in off the near post.
The long-suffering fans inside the Estadio de Vallecas were still celebrating their team taking the lead for the first time in over three months when they had another goal to toast, Arbilla's speculative shot deflecting off a defender and beyond Caballero.
Things got even better for Paco Jemez's side right on half-time, when Larrivey was brought down in the area by Sergio Sanchez as the striker tried to control a high ball. Rayo were awarded a penalty and Sanchez, who had been booked after just five minutes, was sent off.
Larrivey coolly sent Caballero the wrong way from the spot and Rayo had an advantage even they were not capable of relinquishing.
With just under half an hour remaining, Falque got his second goal, exhibiting the same quick feet and ability to float past defenders as he did in the first goal.
Marcos Angeleri failed to properly clear the ball on the right wing and it was picked up by Nacho. The defender played in Larrivey, who shimmied on the spot to play in Falque, and the youngster did the rest, beating a defender before striking the ball towards the bottom corner, ricocheting off the outstretched arm of Caballero on its way in.
Malaga were not completely finished, and substitute Iakovenko almost scored with his first touch. He did not have to wait much longer before getting on the scoresheet in his debut, arriving in the box to slam home a cross from Nordin Amrabat.