Ming fired in 31 points and had seven rebounds for Houston, while McGrady had 27 points. The only other Houston player to hit double figures was Rafer Alston with 16.
Houston has now won two in a row and is holding on to fifth place in the Western Conference playoff picture.
Rashard Lewis paced the Sonics with 20 points to take over fourth place on the team's all-time scoring list. His 10,154 points moved him ahead of Shawn Kemp's 10,148. But Seattle has lost five of its last six games.
Mikael Gelabale had 13 points and Damien Wilkins tallied 13 points for Seattle.