Barney hit a pair of RBI doubles as he went 2-for-3 and Ransom went 2-for-4 with a home run.
Both players also made nice defensive plays in the seventh with men in scoring position to preserve the Cubs' lead.
Kevin Gregg got the final out of the eighth with men on second and third and worked a perfect ninth to get his fourth save.
After a 5-13 start to the season, the Cubs have won five of seven.
San Diego's Clayton Richard (0-3) gave up five runs and seven hits, including two home runs, in 5 2/3 innings.
Everth Cabrera went 3 for 4 and scored two runs.
Tied at 3 in the sixth, Ransom hit a two-out RBI single to score Alfonso Soriano and Barney followed with an RBI double to drive in Ransom and make it 5-3.
Michael Bowden (1-1) got the win in relief of Jeff Samardzija, who allowed three runs and four hits in five innings. He struck out eight and walked four.
The bullpen's turnaround has been one of the primary reasons for the Cubs' improvement. The relievers have a 1.35 ERA in their past 12 games since April 18.
Barney made a diving stop of a ball headed for right field to rob Chase Headley of an RBI hit in the seventh with men on first and second.
Ransom ended a bases-loaded threat later in the inning with a running, barehanded pick and throw to get Jedd Gyorko at first.
Trailing 1-0, Scott Hairston and Ransom each hit solo homers in the second to give the Cubs a 2-1 lead.
[to top of second column]
Barney added an RBI double to score Welington Castillo in the fourth to make it 3-1.
The Padres rallied in the fifth. They loaded the bases with two outs on a single by Cabrera and walks to Carlos Quentin and Chris Denorfia. Yonder Alonso hit a two-run single to tie the game at 3-3.
Cabrera opened up the scoring. Cabrera walked to lead off the game, advanced to second on a single and scored after a pair of wild pitches by Samardzija, the second of which came on a Quentin strikeout.
Soriano went 2 for 4 with a double and a run scored.
NOTES: Padres manager Bud Black said relievers Huston Street and Luke Gregorson were not available for Monday's game. Street and Gregorson had both worked in San Diego's prior three games. ... Padres pitcher Tyson Ross will work in middle relief during his rehab appearance Tuesday with Triple-A Tuscon. Ross has been on the disabled list since April 20 with an impingement in his left shoulder. ... The Cubs acquired Ransom on April 16 off waivers from the Padres. Ransom was 0 for 11 with San Diego on the season. ... Samardzija's eight strikeouts on the night gave him 47 in the month of April, the second most by a Cubs pitcher for the month. Matt Garza is first with 51 in 2011. ... Cubs pitcher Scott Baker (60-day DL) threw from 45 feet as he begins a throwing program while rehabbing from Tommy John surgery. ... Reliever Kyuji Fujikawa threw a side session prior to the game. He's expected to throw another bullpen on Thursday before making a rehab appearance with Triple-A Iowa on Sunday. Fujikawa has been on the disabled list since April 13 with a forearm strain.
Copyright 2013 The Associated
Press. All rights reserved. This material may not be published,
broadcast, rewritten or redistributed.