Ronaldo, who missed the tour of Thailand and Australia to deal with a family issue, started the game but was substituted after 45 minutes.
The 37-year-old had one chance in the first half but fired over the crossbar after picking up Donny van de Beek's pass on the left side of the penalty area.
His half-time replacement, Amad Diallo, gave United the lead shortly after the break before Alvaro Garcia equalised.
After picking his first choice XI in the defeat to Atletico Madrid in Oslo 24 hours earlier, Ten Hag selected a mixture of fringe players and youngsters against Rayo.
Both Martinez and Eriksen were withdrawn in the second half before Ten Hag handed a debut to 17-year-old midfielder Isak Hansen late on.
After a goalless first half, Amad put United ahead from close range after Alex Telles had seen his shot from outside the penalty area come back off the goalkeeper.
Former United striker Radamel Falcao almost equalised soon afterwards with a shot that hit the crossbar but it wasn't long before Rayo levelled through Garcia.
The result means United end their preseason fixture list with three wins, two draws and a defeat from their six games.
Ten Hag has another week to prepare his players before kicking off the new Premier League season with a game against Brighton at Old Trafford on Aug. 7.