Messi finished the match with two goals, and Barcelona keeper Jose Manuel Pinto turned away seven Rayo shots in his second start of the season.
Rayo tried to slow down the Catalans attack with more physical play, drawing 12 fouls in the first half alone, and totaled four yellow cards before the final whistle.
In the 25th minute, Villa started the onslaught on a fastbreak with a slippery through ball by Messi, and rifled in a shot in the center of the box. It was Villa's eighth La Liga goal this season, and Messi's tenth assist.
The pair hooked up again in the 40th, but with Villa passing off to Messi for a left-footed shot that landed in the bottom left corner of the net. The Argentinean now has 42 goals in 27 La Liga matches this season.
Working off one of their nine corner kicks, Raul Tamudo broke Rayo through in the 70th minute, sliding past the Barcelona back line with a low cross from Piti.
Messi later padded the Catalans lead in the match and in the La Liga standings with a chip shot goal that floated and dropped behind diving Rayo keeper Ruben in the 57th.
The highlights for the match can be viewed below.