BARCELONA, Spain (AP) — While Barcelona and Real Madrid recover from scares in the Champions League, Real Sociedad visits Rayo Vallecano on Sunday in a match between Spain's biggest surprises.

Barcelona visits Real Zaragoza with a 13-point lead in the Spanish league over Madrid, which is at Athletic Bilbao, also on Sunday.

Barcelona needed Lionel Messi on a sore right hamstring as a late substitute to help it rally past Paris Saint-Germain and into the semifinals on Wednesday, while Madrid survived a surge from Galatasaray the day before.

Sociedad is in fourth place and must win at Rayo to ensure it keeps its hold of the last Champions league berth.

Sociedad's dynamic attacking style with interchangeable parts led by Carlos Vela, Antoine Griezmann and Xavi Prieto is on a league-best run of only one loss in its last 20 games.

The San-Sebastian based club has risen past other European hopefuls and is currently two points above fifth-place Valencia, which plays at Espanyol on Saturday.

"We are near the top because we play as a very talented group, not just as a collection of individual players," Griezmann said. "I can't wait to see where we will end up in the standings. It's a dream for me and for any player who has come up with this club to play in the Champions League. Still, we have to go forward game by game."

Many expected Rayo to struggle at the bottom this season, but coach Paco Jemez's attack-minded game plan has guided the Madrid club to safety, and now they have even bigger goals. It is in ninth place but only three points out of a Europa League spot.

Besides Barcelona and Sociedad, Rayo is the league's other pass-happy side fueled by forwards Francisco "Piti" Medina, Alhassane "Lass" Bangoura and striker Leo Baptistao.

"The game against Sociedad is our most important one because it will be key for us to be able to make a jump up the standings," Rayo defender Alejandro Galvez said. "They are a tough rival that has gone a long time without losing. We know that we will have to give it our all for the entire game. We can't get distracted because Sociedad has a lot of firepower up front and they can score at any moment."

Messi is still not fully recovered from a hamstring pull that caused him to miss last weekend's 5-0 rout over Mallorca and had on the bench on Wednesday against PSG.

But when PSG scored, Messi went on and started the move that led to Pedro Rodriguez's goal that swung the match back in Barcelona's favor for good.

Barcelona said Thursday that Messi had not aggravated his injury by playing against PSG and that his progress would determine his availability for upcoming games.

That means the Argentina forward could rest again against a Zaragoza side that is winless in 13 rounds.

"We still have two league games to play before the Champions League semifinals," Barcelona midfielder Sergio Busquets said. "If we win those six points in play we will have taken a huge step toward the title."

Cristiano Ronaldo scored twice on Tuesday in Istanbul to ensure Madrid moved past Galatasaray 5-3 on aggregate, but only after a three-goal burst by the Turkish side.

Madrid has long given up on defending its Spanish league title and is focusing its efforts on adding to its record nine European Cups.

Even so, Bilbao almost always promises goals thanks to its exciting attack and even more porous defense, and the crowd at San Mames Stadium always gives Madrid a loud welcome.

Real Betis has a chance to avenge its 5-1 loss at Sevilla from earlier this season when it hosts its crosstown rival on Friday in Spain's most heated city derby.

Also Saturday, Malaga hosts Osasuna after exiting the Champions League, Getafe is at Valladolid, and Levante faces Deportivo La Coruna at home.

Third-place Atletico Madrid plays visiting Granada on Sunday. Mallorca hosts Celta Vigo on Monday in a meeting of Spain's bottom two sides. Both strugglers are level on points and three from safety.