Danks followed an RBI single by Paul Konerko earlier in the inning with a rap to center field that scored two runs and secured Chicago's ninth win in their last 11 games.
Danks went 3-for-4 in the game with a pair of doubles. Avisail Garcia and Alexei Ramirez both had an RBI apiece for the White Sox.
Donnie Veal (2-3) picked up the win in relief of Jose Quintana, who leaded the Major Leagues with 16 no-decision starts.
Erik Bedard (3-10) was on the wrong end of the decision for the Astros, who have lost five of their last eight. Bedard presided over the three-run Chicago eighth and was hung with the loss on three runs off five hits and walk with two strikeouts.
Matt Dominguez went 3-for-4 and drove in two runs for Houston. The Astros broke a 1-1 tie in the sixth on his RBI single.