BARCELONA, Spain -- Real Sociedad lost its second game this week in agonizing fashion on Saturday, when Rayo Vallecano substitute Jonathan Viera earned and converted an 89th-minute penalty in the Spanish league.
Sociedad had already fallen at Bayer Leverkusen to an injury-time free kick in the Champions League on Tuesday.
The Basque side has gone winless in its last nine games in all competitions.
Rayo's Adrian Gonzalez and Joaquin Larrivey both hit the woodwork in the first half. But Sociedad improved after the restart and appeared set to get a point until goalkeeper Claudio Bravo tripped Viera in the area.
Rayo's second win in eight rounds broke a six-game losing streak and lifted it out of last place.
Also, Elche forward Ferran "Coro" Corominas scored two goals in a 2-1 win over Espanyol at home, earning the promoted side its second straight victory.
Elche outplayed Espanyol in the first half and went ahead in the 40th when Coro -- a former Espanyol player -- outmanoeuvred defender Raul Rodriguez to control a flicked-on throw-in before firing by goalkeeper Kiko Casilla.
Espanyol refreshed its attack after halftime and substitute Thievy Bifouma capped a passing combination to level in the 66th.
But just when the visitors looked close to turning the score around, Coro used a quick dribble to get away from Rodriguez and grabbed his second goal in the 74th.
Espanyol finished with 10 men after Victor Sanchez received his second booking in the 88th.
"We have 30 games left and time enough to correct this and see what we are doing wrong," coach Javier Aguirre said after Espanyol's third loss in a row. "We gave away the first half and it's normal to lose that way. We have to get together, talk, and get back to basics to move forward."
Later, Spanish leader Barcelona aimed for an eighth straight win in as many games to start the season when it hosted Valladolid, while Real Madrid visited Levante.