Leading 2-1 from the first leg last month thanks to William Carvalho's winner, Betis controlled the second leg at the Benito Villamarin before late drama saw it finish 1-1.
The home side were content to keep possession and ensure Rayo had few chances to threaten, with Nabil Fekir mustering the first meaningful effort on target after 72 minutes had been played.
That was until the 80th minute, when former Manchester United forward Bebe unleashed a spectacular strike from a free-kick to level the aggregate scores.
However, in injury time, Borja Iglesias bundled home the equaliser to secure Betis' 3-2 aggregate win.
Betis saw a five-game unbeaten run end in a derby defeat to Sevilla last weekend, but almost put the tie beyond reasonable doubt after just six minutes, Juanmi seeing his header saved.
Isi Palazon fired narrowly wide for Rayo, and Pathe Ciss missed with a header, but there was little to trouble Betis goalkeeper Claudio Bravo in the first half.
Betis looked the more likely after the restart, with Sergio Canales and Carvalho each blasting shots over before Fekir at last produced an effort on target from inside the box, one that Luca Zidane held comfortably.
Andoni Iraola tried to provoke a late fightback, introducing Bebe from the bench, and he responded just three minutes later with a quite stunning strike from 35 yards out that left Bravo with little chance.
Just as extra time loomed, Betis snatched the decider. Bravo picked out Joaquin with a precise kick, the veteran slid the ball to Canales and, as his effort deflected towards the far post, Borja arrived to turn it home under pressure.