CHICAGO -- John Danks is enjoying success and making it look easy with a string of impressive performances of late.
But the left-hander knows that getting to this point -- nearly two years removed from shoulder surgery -- was anything but easy.
"It's been a long, frustrating road to get back to here," Danks said. "There were some days where you were having to fight doubt from creeping in.
"I think I'm beyond that."
Gordon Beckham and Dayan Viciedo hit two-run home runs, Danks pitched effectively into the seventh inning and the Chicago White Sox snapped a four-game losing streak with an 8-2 victory over the San Francisco Giants on Tuesday night.
The slumping White Sox had managed a total of six runs in their previous four games, but busted through with a slew of clutch hits.
It was plenty of support for Danks (6-5), who settled down after a somewhat slow start and gave up two runs -- one earned -- and five hits in 6 1/3 innings. In his last five starts, the left-hander is 3-1 with a 1.51 ERA. His ERA for the season is down to 3.97.
"He has really gotten it together, from where he started early in the year," manager Robin Ventura said. "He has pitched to where he's always giving us a chance right now. He becomes tough when he has the feel of the changeup like that and spotting his fastball. It just seems like he has a little more on it as far as spotting his fastball."
Viciedo, who was just 2 for 23 on the homestand before Tuesday, went 2 for 4. His fifth-inning blast ended a stretch of 51 at-bats without an RBI.
Hunter Pence went 2 for 4 with a home run for the Giants, who have dropped four straight and seven of eight. Giants starter Matt Cain (1-5) allowed eight runs -- seven earned -- and 10 hits in five innings.
"He got off to a good start," San Francisco manager Bruce Bochy said of Cain. "Those first two innings, he looked real sharp. He looked like he was on track. Then the third inning got a little long there, long at-bat and he ended up giving up a home run. Then he just got derailed."
Pence opened the scoring with a homer in the first inning, and the Giants made it 2-0 with an unearned run in the third.
The White Sox tied it in the bottom of the third as Adam Eaton singled with two outs, stole second and then trotted home on Beckham's two-run shot.
Alejandro De Aza popped up in foul ground on the first pitch for the second out, but Tyler Flowers drew a walk to drive in a run and make it 3-2. Eaton followed with a slow grounder to shortstop that Brandon Crawford fielded cleanly but threw wide of first base after rushing to get the speedy Eaton.
Eaton was credited with a single and one RBI as both Ramirez and Viciedo scored for the three-run lead. Crawford was charged with an error for allowing the second run to score and both runners (Flowers and Eaton) to advance a base.
Chicago added three runs in the fifth to break the game open. Adam Dunn had an RBI single and two batters later Viciedo hit a two-run, two-out homer for an 8-2 margin.
"We needed it," Beckham said. "It was nice to break out against a good team."
Bochy was a teammate of Tony Gwynn's and later managed the Hall of Famer, who died Monday. "Just a huge loss for baseball and San Diego," Bochy said. "We all know what a great player he was and a great hitter. But he is getting recognized for being such a tremendous person." ... White Sox C Tyler Flowers had a bases-loaded walk to drive in a run, but is 18 for his last 111 at-bats with 50 Ks as his average dropped to .247. ... Giants OF Angel Pagan (lower back) was out of the lineup for a second straight game and is listed as day-to-day. ... C Buster Posey was used at DH after taking a foul off mask on Sunday. ... The finale of the brief two-game series has a marquee pitching matchup of RHP Tim Hudson (7-2, 1.81) vs. LHP Chris Sale (5-1. 1.97).