After Reymond Fuentes singled, Jose Casilla relieved Petit and walked Jace Peterson to load the bases. Up came Yeison Asencio, who lined a two-run single. Medica, a first baseman who's trying to claim a reserve role on the Padres' Opening Day roster, then delivered his homer.
Medica improved to 8-for-11 this spring by adding an eighth-inning RBI double. The Giants avoided a shutout in the bottom half of the inning when Tyler Colvin lined a two-run single.
Earlier, pitching proved dominant. Starters Tim Lincecum of the Giants and Josh Johnson of the Padres set the tone by throwing two scoreless innings apiece.
"Overall, I feel a lot closer to where I was in 2009, 2010, '11," said Johnson, who led the National League in ERA (2.30) in 2010 while a member of the Marlins.
Up next: The Padres return to the Peoria Sports Complex on Tuesday to face the D-backs at 12:05 p.m. PT. Eric Stults will make his second appearance of the spring. He routinely fell behind hitters in his first start of the spring Thursday against the Mariners, allowing three runs on three hits in two innings. The left-hander also walked one. Stults figures to be the No. 5 starter in the team's starting rotation. He led the Padres in wins (11) and innings (203 2/3) last season.
Chris Haft is a reporter for MLB.com. Read his blog, Haft-Baked Ideas, and follow him on Twitter at @sfgiantsbeat. This story was not subject to the approval of Major League Baseball or its clubs.