After Dani Alves had put them ahead after 16 minutes, Messi bagged his double before half time to extend Barca's lead at the top of Group G although Celtic, who face Benfica later, can still overtake them if they win their last two games and Barca slip-up.
Messi, who was top scorer in the competition for a record fourth time last season, now has five goals from five games and he has 80 for the calendar year as he pursues Gerd Muller's 85 playing for Bayern Munich and Germany in 1972.
And he moved level with Ruud van Nistelrooy on 56 Champions League goals behind Raul, the competition's all time scorer with 71.
Messi though was as unassuming as ever after the game.
"My aim was just to get the ball, create chances and that we win the game, that is what is important," he said.
Wwe knew we couldn't afford to make mistakes after what happened against Celtic and that we had to go out strongly even though it is difficult to play away in this competition."
Barca had lost their previous match away to Celtic 2-1 despite dominating possession but were unable to make the most of their chances.
"Against Celtic we had the same number of opportunities but sometimes they go in and sometimes they don't," said coach Tito Vilanova.
"Everyone talks about Leo, the goals and the records but it is more his awareness and tactics. The way he defends and attacks and helps the team in all areas.
"The team showed how great they are as this was a difficult game in the cold on an artificial pitch although some of them have played on it before, and they played an excellent match.
"It was important for us not to have to qualify in the final game which will not be easy against Benfica."
Spartak coach Unai Emery was hampered by a number of injuries including Artem Dzyuba and Aiden McGeady while Nicolas Pareja was suspended.
Carles Puyol returned to the Barca defence in the weekend victory over Zaragoza for the first time since he dislocated his elbow in the Champions League clash with Benfica early in October, but Vilanova chose to rest him with Javier Mascherano partnering Gerard Pique at the heart of the defence.
Barca forged the first opportunity when Pedro Rodriguez chested down a Xavi Hernandez pass but his volley was saved well by keeper Andrey Dikan.
Spartak may be struggling in Europe but they have been playing well domestically and are the top scorers in the Russian top flight. A well worked corner routine could have seen them go ahead but Dmitriy Kombarov side footed over from 12 yards.
Barca though were less forgiving as Alves fired home a loose ball on the edge of the area minutes later.
The visitors had control of the midfield but Spartak were dangerous on the break and Marek Suchy failed to hit the target from an Emmanuel Emenike cross after being left unmarked.
Barca were fully exposing Spartak's weakness at the back with Messi getting his first of the night.
Andres Iniesta saw his shot saved by the keeper but Messi following up knocked the ball home with his weaker right foot.
Spartak were also stretching Barca's defence but they continued to waste their openings with keeper Victor Valdes not even forced into making a serious save. Jose Jurado crossed for Emenike but stretching he also failed to hit the target.
Emery said Spartak's aim was to copy Celtic's achievement but they were leaving wide spaces at the back for a charged up Barca and Messi gave them a commanding 3-0 lead before the break.
Latching onto a Pedro pass he went round the keeper and slotted home.
After the restart Barca eased off and Spartak had more of the ball but with the quality they have in attack they continued to create chances.
Cesc Fabregas linked up with Iniesta but after receiving the ball back he was denied by another good save from Dikan and then minutes later Pedro headed over from close range.
Emery tried bringing on Zhano Ananidze and Welliton Soares but the Spartak players' heads had started to drop and apart from an opportunity for Evgeni Makeev when he fail to control the ball in the box, they made few chances to get back into the game as the match wore on.
Photos: Harbhajan Singh-Geeta Basra's TV outing with daughter Hinaya
Photos: Malaika Arora flaunts ripped jeans like a boss!
Photos: Vaani Kapoor, Kriti Sanon, Dia Mirza sizzle on the ramp
Photos: Kalki Koechlin, Konkana Sen Sharma at a bash in Mumbai
Photos: Akshay Kumar, Aarav, Sonam Kapoor at Mumbai airport