NEW YORK -- The Red Sox had Mariano Rivera teetering on the brink of a blown save, rekindling memories from that historic 2004 season when they seemed to do it habitually against a closer who will likely make the Hall of Fame as soon as he's eligible.

But just like that, Rivera escaped in Houdini-like fashion, proving again why he is one of the best of all-time.

It was one drama-filled top of the ninth inning on Saturday afternoon, with Rivera blowing out the candles on a nearly epic Boston rally in what wound up a 2-1 victory for New York.

"We gave ourselves a great chance, and with really good at-bats," said Red Sox manager Terry Francona. "And then, Mariano went to work and pretty much carved us up for three hitters. He left himself no wiggle room and didn't need it. We've seen him do that."

Rivera is 23-for-23 in save opportunities this season and has 466 saves for his career.

For eight innings, the Red Sox hadn't done a thing offensively. Mike Mussina, looking like twice the pitcher he was when the Red Sox rocked him twice in April, fired six shutout innings. Relievers Jose Veras and Kyle Farnsworth stifled Boston in the seventh and eighth.

The Red Sox had pitched effectively as well, with rookie Justin Masterson giving up two runs over six innings in his Yankee Stadium debut.

"I think it was a really good game watching it," said Masterson. "It seemed like there was a lot of energy, a lot of fun. Great defense. Decent pitching. There at the end, [we] almost [had] a nice little comeback, which could have been really cool."

As it has so often in the recent years of this rivalry, the game came down to Rivera.

Down, 2-0, J.D. Drew led off the top of the ninth with a single up the middle. Manny Ramirez was then hit for the third time in the game, making it first and second with nobody out. In all, there were seven hit hit batsmen in the game, matching the all-time record.

A single to right by Mike Lowell sliced the deficit to one and filled Yankee Stadium with tension.

After Kevin Youkilis was hit by a pitch, the Sox had the bases loaded with nobody out. All that was needed to tie the game was a sacrifice fly, a softly hit grounder to the right side, a walk, a hit batter or a hit. So many options, none of which Rivera was in the mood for.

First, he struck out Coco Crisp on three pitches, with the switch-hitter taking a feeble swing on strike three. Up stepped the heavily slumping Jason Varitek, who popped up a 2-0 pitch to first. All the pressure then shifted to Julio Lugo, who struck out to cap both the game and his five-pitch at-bat.

"We had an unbelievable opportunity to tie the game," said Lowell. "Bases loaded, no outs. You like your odds of getting one in. But Hall of Fame closers, I guess, have a knack for getting out of those. He did, and that was the result."

Varitek, who is in the midst of the worst offensive struggles of his career, tried to find the words to sum up his frustration.

"It was probably up just enough where I just cut through it," said Varitek, who has six hits in his past 59 at-bats. "I still wanted to stay aggressive there. I didn't get it done. He's Mariano Rivera. But in that situation, I got myself out."

If there is something that has defined Rivera as much as his cutter, it's his resolve.

"What I tell myself is, 'Whatever happened [has] happened already. Now you have to make your pitches and get out of it.' You can't have doubts," Rivera said. "You have to make pitches, and if you have doubt, a lot of things can happen."

As for Masterson, he seemed unfazed to be pitching at historic Yankee Stadium for the first time. Unfortunately for the Red Sox, they weren't as unflappable when it came to hitting the nasty offerings of Mussina.

"He threw his curveball. He kind of slowed our bats through the zone," said Red Sox second baseman Dustin Pedroia. "Then when he threw his fastball, he jammed a lot of guys. He did a good job of locating and throwing his cutter. He pitched. That's why he's good."

It was an All-Star-worthy performance for Mussina, who improved to 11-6 while lowering his ERA to 3.64.

Masterson again proved his poise.

"It was just a good game at Yankee Stadium," Masterson said. "It was great."

The Red Sox send Tim Wakefield to the mound Sunday night in hopes of taking three out of four from their rivals. The Yankees counter with Joba Chamberlain, who will be making his first career start against Boston.