The Argentinian scored twice to go to 80 goals so far in 2012, just five behind Muller's record number of goals scored in a calendar year from 1972.
Dani Alves gave Barcelona the lead before Messi's double strike with all the goals coming before half-time.
It was tough on Spartak who showed first but Kim Kallstrom fired over before Pedro almost put the Catalan side in front but his instant shot was superbly parried by goalkeeper Andrei Dykan who showed his quick reactions in the centre of the goal.
Barcelona went ahead in the 16th minute through Dani Alves when he struck a volley cleanly past the goalkeeper after the ball was laid off by Messi at the edge of the area.
The visitors then wasted a great chance to equalise when Emmanuel Emenike's cross from the right found Marek Suchy who had got ahead of his marker but he did not even get a shot on target from less than 12 yards, instead ballooning the ball over.
They were left to rue that when shortly after Barca took a two-goal lead.
Andres Iniesta's shot from a narrow angle brought a parry from the goalkeeper but Messi pounced on the rebound and although he half snatched at the shot the ball bounced into the bottom right-hand corner.
Spartak were still creating chances, Emenike firing over although he was at full stretch.
Messi scored his second of the night and Barca's third six minutes before the break when he timed his run perfectly and latched on to Pedro's superbly weighted pass, got ahead of the defence and rounded the keeper before slotting the ball home.
Emenike shot over at the start of the second half but Barca were weaving the ball around.
Yevgeni Makeev completely miscontrolled the ball when well-positioned and the game was clearly beyond the hosts who had failed to take any of their chances.
Dykan thwarted Messi and Pedro as the game played itself out without further score as Barca breezed through.
Highlights to follow.