McIlroy, who needs to win a green jacket to become just the sixth player to complete the career grand slam, added a 71 to his opening 69 in testing windy conditions at Augusta National to finish four under par.
Spieth recovered from a nightmare start to match that total after a 74 which included failing to make a single birdie on the front nine for the first time in his career.
Out on the course, Spieth’s Ryder Cup partner Patrick Reed was six under after seven holes, with Australian Marc Leishman a shot behind.
All four of McIlroy’s major wins have come after being in the top five after the first round and he started day two in a tie for fourth before three-putting the first.
McIlroy responded immediately to birdie the next two holes, but bogeyed the fourth and sixth to reach the turn in 37 and was disappointed to play the back nine in only two under par with birdies on the 13th and 14th.
“I was one over for the front nine so to shoot two under on the back nine, I would have taken that on the 10th tee,” said McIlroy. “But the way I played I hit some good shots and gave myself putts for birdies.
“It felt like I left a couple out there on 17 and 18 so I could have shot something in the 60s, but overall pretty pleased with how I played.”
Spieth held a two-shot overnight lead after an opening 66, but saw that disappear with a double bogey on the first after driving into the trees to the right of the fairway.
Another errant tee shot on the par-five second and a three-putt from long range added up to a second consecutive six, while a poor bunker shot on the seventh also resulted in a bogey.
Spieth went to the turn in 40 and failed to card a single birdie on the front nine at Augusta National for the first time in his career, but steadied the ship with birdies on the 13th and 15th and missed from 10 feet on the last to regain top spot on the leaderboard.
The biggest stumbling block between McIlroy joining Gene Sarazen, Ben Hogan, Gary Player, Jack Nicklaus and Tiger Woods in winning all four majors appeared to be Spieth, whose opening 66 means he has amazingly led or shared the lead after nine of his 17 rounds at Augusta.
Spieth led after the third round in 2014, from start to finish in 2015 and for 54 holes in defence of his title, although he did then blow a five-shot lead with nine holes to play as Sheffield’s Danny Willett took full advantage with a closing 67.
Woods was among the late starters and had moved three shots closer to the lead without hitting a shot, but followed a perfect drive on the first by missing the green and making bogey to drop back to two over.
And things went from bad to worse for the 14-time major winner when he fired his approach into bushes over the green on the fifth to run up a double bogey and drop back from the lead to four over par.
Phil Mickelson, seeking to become the oldest winner in Masters history at 47, was two off the lead before running up a triple bogey on the ninth after his recovery attempt ricocheted off a tree.
And despite bouncing back immediately with a birdie on the 10th, the five-time major winner dropped five shots in his last eight holes to shoot 79 and slump to five over par.
Justin Rose, who carded a second round of 70 in tricky conditions to reach two under par, said: “I’m pleased with it. I saw some signs of better putting and felt more comfortable on the greens. I freed up my stroke a little bit and that was good.
“I still made a couple of mistakes here and there and it was unfortunate to three-putt 12 after doing the hard work there, but it was tough not to make mistakes. It was fairly breezy out there and the greens got pretty crusty.”