Real claimed the overnight lead thanks to Saturday's 2-0 home win over Granada before Atletico restored their one-point advantage with a typically efficient victory in the Madrid suburbs.
Champions Barcelona can join them on 54 points from 21 matches by beating Malaga at home in the late kick-off.
The Brazil-born forward fed Jose Sosa and despite having a clear shooting opportunity he unselfishly squared for Arda to finish into an empty net.
Rayo, who play some attractive football but have a disastrously leaky defence, pulled a goal back in the 40th minute when Viera finished off a sweeping move and Arda scored his second moments before the break.
The stocky and heavily-bearded midfielder nipped in at the back post and volleyed a deflected Gabi free kick in from a tight angle.
Costa, the second-highest scorer in La Liga this season behind Cristiano Ronaldo, appeared to have netted his 20th of the campaign in the 75th minute but it was ruled an own goal and attributed to Rayo midfielder Saul Niguez.
Joaquin Larrivay nodded a second for Rayo a minute later and Atletico had to withstand late pressure but Courtois capped another fine performance with a couple of impressive saves.
- Sports & Recreation
- Thibaut Courtois
- Jonathan Viera
- Diego Costa