Ter Stegen, Semedo, Piqué, Umtiti, Jordi Alba, Busquets (Malcom, 84'), Arturo Vidal, Arthur (Dembélé, 45'), Messi (c), Coutinho (Rakitic, min. 80) y Luis Suárez.
Dimitrievski, Advíncula, Velázquez, Gálvez, Amat (c) (Pozo, 64'), Alex Moreno, Comesaña, Imbula, Bebé, Álvaro (Embarba, min. 80) y De Tomás.
0-1, min. 24: De Tomás marca con un disparo desde fuera del área. 1-1, min. 38: Piqué remata de cabeza una falta botada por Messi. 2-1, min. 50: Messi, de penalti. 3-1, min. 81: Luis Suárez aprovecha un pase de Rakitic desde la línea de fondo
Árbitro: Melero López (comité andaluz)
Mostró cartulina amarilla a Velázquez (min. 68) y Busquets (min. 80).
Partido de la jornada 27 de LaLiga Santander, disputado en el Camp Nou ante 74.158 espectadores.
Barcelona came from behind to beat Rayo Vallecano 3-1 and restore their seven point lead at the top of La Liga.
Raul de Tomas gave Rayo the lead at Camp Nou but Barça struck back with goals from Gerard Pique, Lionel Messi and Luis Suarez.
The win restored the Catalan side's advantage over Atletico Madrid at the head of La Liga after Diego Simeone's side beat Leganes earlier in the day.
It also sets Ernesto Valverde's men up nicely for Wednesday's Champions League game against Lyon. The first leg of the last 16 tie ended goalless in France.
Valverde named a strong team for Rayo's visit, with just Sergi Roberto, Ivan Rakitic and Ousmane Dembele rested in respect to the side which beat Real Madrid 1-0 last weekend.
Barca dominated possession without a punch early on and De Tomas' brilliant 20-yard effort gave Rayo the lead in the first half.
Pique levelled things up before the break when he continued his good recent form by heading in Messi's brilliant free kick.
Valverde didn't like what he'd seen in the first half, though, and opted for more pace at the interval. Dembele came on for Arthur as Barça switched to 4-2-3-1.
The change had the desired affect. The Blaugrana looked much better and took the lead when Messi slotted home after Jordi Amat had brought down Nelson Semedo in the penalty area.
Barca missed chances to extend their lead and Jordi Alba blocked a De Tomas strike at the other end before Suarez sealed the points.
Suarez fed Dembele, who crossed the ball back to him in the box. The Uruguayan then exchanged passes with Ivan Rakitic before slotting home.