San Francisco had won each of Petit's previous six starts and jumped ahead, 3-1, on Hunter Pence's two-run homer in the third inning. It was Pence's 27th homer of the season, extending his personal-best total and representing the most hit by a Giant in one season since Barry Bonds bowed out with 28 in 2007.
Then San Diego recorded six consecutive two-out hits off Petit (4-1). Chase Headley doubled and scored on Medica's single. Ex-Giant Jesus Guzman then roped a homer to left field, his ninth of the season. Singles by Alexi Amarista, Chris Robinson and opposing pitcher Eric Stults accounted for the inning's final run and finished Petit.
The fulcrum upon which the inning rested was Medica's 14-pitch at-bat. Until then, Petit had been mostly effective, retiring 11 consecutive Padres between Chris Denorfia's game-opening home run and Headley's double. But after working the count to 3-2, Medica fouled off six pitches in a row before slapping his hit to center field on a 90 mph cut fastball.
"This was a big factor in my performance today, because he was able to time all of my pitches," Petit said, translated by reporter Manolo Hernandez Douen. "I made so many pitches, I threw everything to him. I give him a lot of credit because I feel that he timed them all and he drained me mentally."
For Medica, facing Petit was a matter of competitive survival.
"He was throwing everything," Medica said. "He kept on making good pitches and I was just getting enough of them to stay alive. Finally got one in fair territory."
Padres manager Bud Black called the fourth inning one of the best that his club has sustained this season.
"I'm sure there's a handful of others, but this was a good one," Black said. "We're down, we've got a rookie at the plate battling, we've got some of our bench players in the lineup playing. It was great. After Tommy's at-bat, I could see the energy shift a little bit in the dugout as the game went on."
The energy shifted dramatically in the ninth inning, when left-hander Mike Kickham, the last of six relievers Giants manager Bruce Bochy used, yielded four runs and six hits. Kickham's predecessors allowed only three hits in 4 1/3 innings.
In fairness to Kickham, he had appeared just once since throwing a scoreless inning at Los Angeles on Sept. 14.
"It's hard to stay sharp," said a sympathetic Bochy, noting he needed Kickham to consume the ninth due to Petit's brief outing.
Petit's 3 2/3-inning stint was his shortest start with the Giants, and the five runs he yielded was the most he had allowed with them. Nevertheless, he remained confident that he will arrive in Spring Training with a chance to make the season-opening starting rotation.
"I know that this outing for me was not a good one, but I gave them enough to think about," Petit said.
The afternoon included redeeming and entertaining moments for the Giants. Stationed in left field, Juan Perez unleashed a powerful fifth-inning throw home to retire Headley, who tried to score from second base on Guzman's two-out single. It was Perez's eighth outfield assist in just 210 innings played.
"I take a lot of pride in my defense," said Perez, a 26-year-old rookie. "I take it personal."
Earlier in that inning, right-hander Jake Dunning startled the AT&T Park crowd by grabbing Jedd Gyorko's comebacker barehanded before throwing to first base for the second out. Dunning proceeded to walk the next two hitters and surrender Guzman's single before Perez rescued him. The experience taught Dunning to remember to use his gloved hand whenever possible.
"I didn't make many good pitches afterward," Dunning said.
The Padres (76-85) inched one game ahead of the Giants (75-86) into third place in the NL West, with Sunday's regular-season finale remaining. Asked about the importance of finishing tied for third instead of alone in fourth, Bochy said, "That's not what we set out to do, but at this point that would be nice."