Hamilton, who will start for the American League in Tuesday's All-Star game, went 3-for-5 and leads the majors with 93 RBIs. He has driven in 11 over his last seven games.
Pitching on three days' rest, Mendoza (2-3) allowed just three hits and one walk to win for the first time in six starts. He allowed eight runs in 1 1-3 innings in Texas' 9-6 loss to the Los Angeles Angels on Monday.
Gavin Floyd (10-5) lasted just 2 2-3 innings in his shortest outing of the season for the White Sox. Floyd, who was 6-1 in his previous eight starts, walked a career-high seven and allowed six runs.
Jim Thome hit his 524th career homer in the seventh for the White Sox, who had won 11 of 14.
Ian Kinsler extended his hitting streak to 23 games, tying fellow Rangers All-Star Michael Young for the longest in baseball this season. David Murphy and Chris Davis homered for Texas, which leads the majors in runs scored.
Eddie Guardado got Paul Konerko to fly out with the bases loaded in the ninth to earn his second save of the season.
The Rangers scored five runs in the third to take a 6-0 lead, taking advantage of Floyd's control problems.
Young reached on a leadoff walk and scored on Hamilton's double. Murphy then hit a two-run drive to right on a 1-2 pitch for his 13th homer of the season.
Floyd allowed more two walks and a hit to load the bases. Ramon Vazquez walked to force in a run, and the White Sox brought in D.J. Carrasco to relieve Floyd.
Young capped the third-inning scoring with another bases-loaded walk.
That was plenty of offensive support for Mendoza, who allowed three home runs in the second inning Monday.