New York (27-10-4), which entered with the most points in the NHL, had won five straight and 10 of 11.
Anderson's seventh career shutout, and first since a 44-save effort against Washington on March 25, came nearly two years after Ottawa's winning streak began in New York with a 2-0 victory on Jan. 14, 2010.
Anderson had a busy night, especially in the first period when the Rangers recorded 11 of the first 14 shots and took 12 straight. His best saves came on the same sequence 5½ minutes in when he made a toe stop on Derek Stepan's shot and then sprawled across the crease to get his left pad on Marc Staal's backhand attempt on the rebound.
Anderson also made a point-blank stop on Brad Richards about seven minutes into the third, and another about a minute later on Stepan.
Ottawa became one of the last teams to register a shutout this season, posting its fourth blanking in 37 games at New York. The Blackhawks and Islanders are the only remaining teams without a shutout this season.
Henrik Lundqvist made 21 saves for the Rangers, who had their fourth winning streak of at least five games stopped.
Spezza got the Senators going with a nifty wrist shot from the right circle. Spezza skated into the Rangers zone, after defenseman Chris Phillips beat Brian Boyle to a loose puck in the Ottawa end, and beat Lundqvist on a partial screen 8:54 into the second.
Michalek pushed the lead to 2-0 and sent many fans heading to the exits when he scored his 23rd goal. Michalek beat Lundqvist to the glove side with a wrist shot from the low slot with 6:02 remaining. Less than two minutes later, Spezza scored off a rebound during a power play to make it 3-0 with 4:27 left.
The Rangers were blanked for the first time since a 1-0 loss to Dallas on Dec. 13. They also were handed their fourth regulation loss at home in 19 games (13-4-2).
NOTES: New York C Brandon Dubinsky missed the game because of a sore right shoulder, and LW Wojtek Wolski took his place in the lineup. Dubinsky was injured Tuesday during a shootout win against Phoenix when he was hit by Coyotes forward Taylor Pyatt in the first period. "He's sore," Rangers coach John Tortorella said. "I just want to get him healthy so it doesn't turn into a bigger thing." Wolski played for the first time since Nov. 3. He had been a healthy scratch the previous two games after missing 27 games because of a hernia. ... Ottawa All-Star D Erik Karlsson returned after sitting out Tuesday's game in Pittsburgh because of an upper body injury. He earned assists on the final two goals.