Behind Beckham, Viciedo, White Sox break out of slump in 8-2 rout of Giants

Chicago White Sox's Dayan Viciedo, right, celebrates his two-run home run against the San Francisco Giants with Adam Dunn, who scored, during the fifth inning of a baseball game on Tuesday, June 17, 2014, in Chicago. (AP Photo/Andrew A. Nelles) (The Associated Press)

Chicago White Sox second baseman Gordon Beckham forces out San Francisco Giants' Hunter Pence on a double play during the seventh inning of a baseball game on Tuesday, June 17, 2014, in Chicago. (AP Photo/Andrew A. Nelles) (The Associated Press)

Gordon Beckham and Dayan Viciedo hit two-run home runs, John 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.

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.

Danks (6-5) 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.

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.