BOSTON -- Jonny Gomes knew he'd have another chance at the same pitch after looking bad on a pair of sliders. He didn't miss the next time.
Gomes lined a 2-2 pitch off Luke Gregerson (4-4) into the first row of seats above the Green Monster for his second game-ending homer of the season.
"That guy throws good sliders like he did the inning before and he did to me," said Gomes, who swung and missed badly on two that sailed away. "The first three pitches no one was going to hit them. I let one go and then kind of set my sights on getting one up, and got good wood on it."
Gomes rounded third after his game-ending shot, took his helmet off, held it like a fullback going into the line of scrimmage and was mobbed by his teammates at home plate.
"The clubhouse stuff has been talked about more than his play on the field, but he's been great for us," Boston starting pitcher Jon Lester said of the easygoing Gomes.
"I just had three swings tonight," Gomes said, standing in the middle of clubhouse wearing red, white and blue shorts. "Those guys did a lot of work. Whether it's me or someone else, winning's fun. It's contagious."
Mike Carp had two hits and scored a run for Boston, which is 7-1 on its nine-game homestand that concludes Thursday against the Padres.
"When we get into some of these National League teams, we don't have a lot of history against their guys coming out of the bullpen," Boston manager John Farrell said of the move. "In this case, Gomes had faced Gregerson twice and also hit a walkoff against him previous."
Carlos Quentin went 3 for 4 with a double and two singles for the Padres. San Diego has scored just five runs in its five-game losing streak.
"Little bit up in the strike zone. Threw a couple of good ones down that Gomes swung through," Padres manager Bud Black said of the game-winning homer. "I'm sure he tried to execute the same one that he did the previous two for strikes, just left it a little bit up. Gomes was probably looking for it. Gomes has some pull-side power, he can elevate the ball and that's what he did."
Koji Uehara (2-0) pitched one inning for the win.
The Red Sox squandered a good chance in the eighth. Dustin Pedroia led off with a double off the Monster against Nick Vincent. After David Ortiz was intentionally walked for the second time, Gregerson relieved and retired the next three batters, striking out Daniel Nava and Jarrod Saltalamacchia.
San Diego starter Edinson Volquez pitched six innings on his 30th birthday, giving up one run on seven hits, striking out six with one intentional walk.
"When we lose a game like that, there's nothing we can do," he said. "We battled the whole game. We lost in the ninth. Can't happen. We've got to come back tomorrow and win the next game."
Lester had a similar line over seven, allowing six hits, one run, walking one and striking out five. He entered just 2-4 with a 6.98 ERA in his last eight starts.
Lester labored in the first, throwing 32 pitches and giving up a run. Plate umpire Doug Eddings called time just as Lester was starting to throw a pitch to Chase Headley. It hit him on the foot, but was waved off. Headley then proceeded to have a 10-pitch at-bat, reaching on a single. Kyle Blanks followed with an RBI single to center.
Boston tied it 1-1 when Carp singled leading off the fourth and scored when left fielder Quentin misplayed a carom off the Green Monster on Saltalamacchia's double.
Lester settled down after the first, retiring the Padres in order on just five pitches in the second. He gave up a hit, but needed only 12 in the third.
Volquez struck out the side in the second after allowing Carp's leadoff single.
Both dugouts were warned by Eddings after Volquez hit Jose Iglesias with the first pitch in the third inning.
Red Sox RHP Clay Buchholz, on the 15-day disabled list since June 9 with a neck strain, threw from flat ground at about 100 feet. Buchholz was 9-0 with a 1.71 ERA before the injury. ... The Padres made a lineup change about three hours before the game, moving Quentin from DH to left field and Blanks from left to DH. ... Farrell gave 1B Mike Napoli the day off and inserted Carp at first, batting him sixth. "Trying to get a few more left-handed bats in the lineup," Farrell said. ... Quentin was 0 for 11 against Lester. ... Boston SS Iglesias was named AL rookie of the month for June, the first Red Sox player to win it since Jacoby Ellsbury did it in September 2007. Iglesias hit .395 in 25 games. ... Game time temperature was 87 degrees with a steamy feeling in Fenway Park. ... The clubs conclude the three-game series Thursday afternoon with Boston rookie Allen Webster (0-2, 9.50 ERA) making his fifth major-league start against San Diego left-hander Eric Stults (6-6, 3.51 ERA).