Drew Stubbs hit an opposite-field home run for Colorado to start the eighth inning, breaking a tie before the Rockies (66-92) got two decisive plays in the field to hold on for the victory in the second game of a three-game set. The series concludes at 6:10 p.m. PT on Wednesday.
Barnes saved a home run by making a well-timed leaping grab of Rene Rivera's line drive at the fence in left field to start the eighth inning.
"I hit it well, good hard contact," Rivera said. "I hit it fine. He made a great catch. Sometimes you've just got to tip your hat."
Barnes admitted to having a little fun with some fans before and after the catch.
"One of the guys [in the stands] said, 'He's going to hit a homer right here,' and I said, 'No, I'm going to rob it.' I robbed it and when I got up, I said, 'I told you so,'" Barnes said.
"That's fun. We're here for the fans."
Later in the inning, with two runners on, LeMahieu robbed Alexi Amarista of an RBI single by smothering a ground ball in the hole between first and second base. He then threw to first base for the final out of the inning, preserving the one-run lead.
"That was a big play as well," said Padres manager Bud Black.
The Rockies jumped out to an early 2-0 lead, getting a run in the third inning as Justin Morneau had a two-out, run-scoring single to score Rafael Ynoa, who doubled with one out.
They added a run the following inning on the third of three singles, this one by LeMahieu, as Barnes -- who singled to start the inning -- raced around for a 2-0 lead.
San Diego pitcher Robbie Erlin, getting a start for Tyson Ross, allowed two runs on six hits over his four innings of work. Erlin walked two, struck out two and needed 83 pitches to get 12 outs.
"The fastball into righties, he just couldn't get there," Black said. "He ran some deep counts and just wasn't about to execute the fastball."
Erlin was filling in for Ross, who was shut down for the remainder of the season Tuesday after he came down with soreness and fatigue in his right arm that was later diagnosed as a slight strain of his flexor tendon muscles.
Colorado pitcher Jorge De La Rosa allowed two runs on seven hits with four walks and seven strikeouts. Juan Nicasio (6-6) got the victory by tossing a scoreless seventh inning.
The Padres (75-82) got a run back in the sixth inning as they got to De La Rosa for three hits, including an RBI single with two outs by rookie Rymer Liriano that scored Jedd Gyorko. Amarista later singled into left to drive in Tommy Medica with the tying run.