Unai Lopez opened the scoring for Rayo before Pedri and Dani Olmo scored for Barcelona in the second half.
Barcelona coach Hansi Flick was pleased with their 2-1 win at Rayo Vallecano.AdvertisementAdvertisementFlick later said: "We defended well, but not perfectly. We abused fast balls and they have fast players. In the second half, we improved. Marc Bernal was injured, we have to see how serious it is. He was having a great game.
"It doesn't seem right. We won, but nobody is happy. We have to wait until tomorrow."
On Olmo's goalscoring debut, Flick continued: "He's good, that's why he's in our team. The first minutes were not good: the pressure, the combination... then we changed in the second half. I think we deserved the three points. With him, we had more control of the ball, we combined better. He was very good. He kept the ball for us and also scored.
"If you see the results of recent years... you can see that we suffered in Vallecas. Then we improved in the second half. Another three points. That's nine."