Medica led off the 11th with a swinging bunt down the third-base line for an infield single. Jesus Guzman batted for reliever Nick Vincent (6-3) and hit a ground-rule double that center fielder A.J. Pollock misplayed.
"I feel bad because I'm out there trying to make a play," Pollock said. "It is pretty frustrating, but I don't know what else I could have done."
Josh Collmenter (5-5) intentionally walked Nick Hundley to load the bases, and Amarista slapped a single through a drawn-in infield.
Padres starter Robbie Erlin allowed two runs on three hits and a walk, while striking out seven in seven innings.
The Diamondbacks tied the score in the fourth inning when Martin Prado hit his 14th homer of season. Paul Goldschmidt led off the inning with a single.
After the homer, Padres pitchers retired 24 straight batters.
NOTES: Goldschmidt singled in the fourth inning to extend his hitting streak to 16 games. ... C Miguel Montero was given the day off as Tuffy Gosewisch got his 10th start of the season. ... Arizona GM Kevin Towers said the fate of his team's coaching staff will be determined soon after Sunday's final game. ... The Padres confirmed they are bringing back their coaching staff next season. ... Mark Kotsay was honored before the team's final home game. Kotsay, a 17-year pro, is retiring after Sunday's game. ... Padres SS Ronny Cedeno missed his third straight game after being beaned by Arizona's Heath Bell on Monday night.