Barney and Ransom each drove in a pair of runs and made key defensive plays to help the Cubs beat the San Diego Padres 5-3 on Monday.
Barney went 2 for 3 with two doubles and Ransom went 2 for 4 with a home run.
The Cubs have won five of seven after a 5-13 start.
"Barney's solidified our defense, believe me," Cubs manager Dale Sveum said of his second baseman.
"He's just that guy when he's out there, he's going to do a lot of things throughout the course of a game. But he's going to do at least one thing a day that's gonna change the aspect of the game. It's gonna save pitchers umpteen pitches; whether it's turning a double play or a play like tonight. That's why he won the gold glove, he's the best in the league. That's how much he means to us defensively, he changes the game around defensively."
Sveum was referring to a diving stop that Barney made in the seventh inning to rob Chase Headley of an RBI hit with no outs and men on first and second.
The play came an inning after the Cubs had broken a tie game on run scoring hits by Barney and Ransom.
"The bottom of our order was huge tonight," Sveum said. "Cody came up with a big home run and huge base hit to take the lead back after we just gave it up. So that was huge, he did a nice job again."
Ransom, who was picked up on waivers from the Padres on April 16, ended a bases-loaded threat later in the seventh inning with a running, barehanded pick and throw to get Jedd Gyorko at first.
"That barehanded play saved the game for us," Barney said. "It's nice to have a guy like him who knows how to play the game the right way. He knows the situation, he knows who's running on that barehanded play."
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.
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.
San Diego's Clayton Richard (0-3) gave up five runs and seven hits, including two home runs, in 5 2/3 innings. It was an improvement on his previous start on April 23, when he allowed six earned runs in 1 2/3 innings in a loss to Milwaukee.
"It is (better), but I mean, games like this those things don't matter," Richard said. "When you don't win you don't win. I wish I could have put us in a better position to win a baseball game and I wasn't able to do that, so that's all that really matters."
The Padres loaded the bases with one in the seventh trailing by two and Yonder Alonso came to the plate.
Alonso was then called out on a check swing strike three and Ransom made a great play to get Gyorko to end the inning.
"We just couldn't get the big hit," Padres manager Bud Black said. "They made pitches. A tough call on Yonder with the bases loaded, but we just couldn't seem to cash in when we had a couple guys on. We got the runners in scoring position a couple times. Just couldn't get the big knock."
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.