Updated

Gordon Beckham hit a three-run home run as the Chicago White Sox thumped the Chicago Cubs, 7-0, to avoid a three-game sweep.

Beckham finished the game with four RBI, Alejandro De Aza scored twice while Alexei Ramirez went 2-for-4 with an RBI and a run scored for the White Sox, who had lost six of seven coming into the game.

Gavin Floyd (5-7) got the win as he gave up just four hits and a walk with four strikeouts over 6 1/3 innings. He was 0-2 in his previous three starts.

"Gavin pitched a great game," White Sox manager Robin Ventura said. "He had great command...and really gave us what we needed."

David DeJesus' double in the third and Starlin Castro's triple in the sixth were the only extra-base hits for the Cubs, who have lost five of eight. Randy Wells (1-2) was tagged for three runs on five hits with four walks over 3 2/3 innings.

"It's unacceptable," Wells said of his effort. "It's time to go back to the drawing board."

This game stayed scoreless until the third inning when the White Sox plated two runs. Eduardo Escobar walked to start the inning and De Aza followed suit. A sac bunt moved both runners up a base and Adam Dunn singled home Escobar. Paul Konerko then singled to right to plate De Aza for a 2-0 lead.

The fourth inning saw the White Sox make it a 3-0 game when Beckham singled home Ramirez, who hit a one-out single and later moved to second on a De Aza single.

In the sixth inning, the White Sox used the big bat to add three more. With one out, Escobar singled and De Aza walked. Beckham then blasted a shot over the right field wall for his ninth homer of the year and a 6-0 lead.

Ramirez's RBI single in the seventh scored Alex Rios for a 7-0 lead.

Castro led off the sixth with a triple, but was stranded there as Bryan LaHiar and Alfonso Soriano struck out and Steve Clevenger grounded out to end the frame.

The Cubs were retired in order over the final three innings to cap the shutout.

Game Notes

The White Sox won four of the six meetings with the Cubs this year and have won the season series for the past four campaigns...Chicago second baseman Darwin Barney extended his errorless streak to 56 games. It's the longest by a Cubs infielder since Jeff Baker went 56 games at second base without a blemish from Sept. 3, 2009, June 28, 2011...The Cubs have off Thursday before starting a three-game series in Arizona...The White Sox also have off on Thursday and open a three-game set at home against Milwaukee on Friday.