In need of a positive result after its 2-1 Clasico defeat, Ronald Koeman's men instead suffered a fifth defeat of the season in all competitions courtesy of Radamel Falcao's first-half goal.
Barca went into this latest contest on a run of 13 consecutive LaLiga wins over Rayo in which they had averaged 4.3 goals per game, yet they paid the price for Memphis Depay's missed penalty midway through the second half.
Marc-Andre ter Stegen made a desperate early save to keep out Oscar Trejo's ambitious long-range chip, but it began to look like Barca would keep up that formidable scoring record, Depay going close and Sergio Aguero seeing vague penalty appeals against goalkeeper Stole Dimitrievski dismissed.
Yet it was Rayo who took the lead on the half-hour mark, Trejo robbing Sergio Busquets and threading the ball to Falcao, who turned away from Gerard Pique before finishing low to Ter Stegen's right.
Sergino Dest missed a golden chance to equalise before the break, turning over the bar from point-blank range after some brilliant play from Depay down the left, and Aguero blasted high and wide from inside the box after the United States international had teed him up.
Depay earned the chance to level from the spot after he was clipped from behind by Oscar Valentin, but Dimitrievski saved superbly to his right before bravely gathering the rebound as the Barca forward closed in.
Dimitrievski was more hesitant with a loose ball outside the Rayo box in injury time, but substitute Luuk de Jong's attempted lob landed on the roof of the net.
In eight minutes of injury time, Aguero glanced a diving header wide and then set up Gavi for what looked a simple finish, but the young midfielder scuffed his effort wide.