Thibaut Courtois saved well from Antonio Sanabria before Federico Valverde put Madrid ahead with a poacher's near-post finish. Ramos missed a good chance to double their lead and then Betis fought back, scoring twice in three first-half minutes through Aissa Mandi and William Carvalho.
Madrid equalised just after the break as Dani Carvajal's cross was diverted goalwards by Betis full-back Emerson. The visitors could have gone ahead when Karim Benzema's shot rebounded off the bar and then Emerson was sent off for fouling Luka Jovic before Ramos completed the comeback from the penalty spot with 10 minutes left.
Madrid needed to prove they could score goals after drawing a blank in their La Liga debut at Real Sociedad, and they did that here. The team looked promising going forward throughout, creating chances right from the start, with Benzema in particularly dangerous form. The French striker was Madrid's key man in attack last season, and that won't change any time soon. The win was far from trouble-free, and Madrid found it difficult to contain Betis, but the spirit showed in coming from behind to win will have been pleasing for coach Zinedine Zidane.
An open game and an attacking Madrid team meant Betis had more than their fair share of chances. Playmakers Nabil Fekir and Sergio Canales looked unplayable at times as Madrid conceded two first-half goals for the first time in La Liga since October 2018.
Luka Jovic continues to look out of place in this Real Madrid team, too. Zidane insists that Jovic can partner Benzema and there were some very early positive signs, but often the Serbia striker's movement looks out of sync with his teammates.
Manager Rating (out of 10)
7 -- Zidane made three changes to the team that drew 0-0 at Real Sociedad. Casemiro and Valverde added steel to the midfield, and Jovic joined Benzema in attack as Zidane tried to add goals to the team. That meant sacrificing pace out wide, with Vinicius and Rodrygo dropping out.
Zidane wasn't happy with his team's lack of midfield control, bringing on Luka Modric (even if the withdrawal of Toni Kroos was enforced) and Isco in an attempt to address the problem, with some success.
Player ratings (1-10; 10 = best, players introduced after 70 minutes get no rating)
GK Thibaut Courtois, 7 -- Made a superb, instinctive reaction save from Sanabria's header to keep it 0-0 but would have liked to do better with Betis' second goal when he was beaten low at his near post.
DF Dani Carvajal, 6 -- Booked for fouling Fekir before half-time. Provided an inch-perfect cross for Madrid's crucial second goal.
DF Raphael Varane, 7 -- Showed trademark quick thinking and reactions to come across to block a Fekir chance early, and looked good all evening.
DF Sergio Ramos, 8 -- Could have changed the course of the game had he scored a very presentable left-footed chance with 15 minutes gone. Went agonisingly close with a second-half free kick, and then scored a late winner with a trademark panenka penalty.
DF Ferland Mendy, 6 -- Had some joy getting forward early on up against the defensively suspect Emerson, but had more defending to do later.
MF Casemiro, 7 -- Back in the team having been surprisingly left on the bench last week. Recovered after looking to be badly hurt by Emerson's stamp with 10 minutes gone. Beaten in the air for Mandi's goal.
MF Fede Valverde, 8 -- Had struggled to find his form when La Liga restarted last season, but this was much, much better. Displayed a previously unseen goalscoring knack with the opener, Madrid's first goal of the season and just his third for the club.
MF Toni Kroos, 6 -- Went off injured early with what looked like a thigh problem. One glorious ball over the top for Benzema just before that.
MF Martin Odegaard, 5 -- Zidane clearly fancies Odegaard and wants to make him a fulcrum in attack. He was on set piece duty here too, swinging in corners left-footed, but only got 45 minutes to show what he could do before being hauled off.
FW Karim Benzema, 8 -- A busy evening. Had an early goal ruled out before turning provider for Valverde with his 82nd La Liga assist. Could have scored more than once, first when Carvajal's ball was turned in by Emerson, then when his shot off the bar looked to cross the line, and again when he couldn't get Valverde's pass on target.
FW Luka Jovic, 5 -- Mostly quiet in his first start since January, failing to make the most of this opportunity to convince Zidane. His most eye-catching moment came in the second half when he was played in by Benzema and brought down by Emerson for his sending off.
MF Luka Modric, 6 -- Replaced an injured Kroos. Got stuck in immediately as Madrid looked to wrestle back control of the match and was booked for a challenge on Guido Rodriguez.
MF Isco, 7 -- Brought on at half-time, replacing Odegaard, and helped the team improve as the game went on.
FW Borja Mayoral, NR -- Came on for Jovic with 20 minutes left and helped win the penalty that gave Madrid the three points.