The win was the fourth in a row for the Kings and put Phoenix 4 1/2 games behind Memphis in the battle for the final playoff spot in the Western Conference.
Thornton led Sacramento with 24 points and 11 rebounds. Beno Udrih scored 19 points and Donte Green added 18.
The Suns, who have lost four consecutive games, were led by Channing Frye and Jared Dudley, who both scored 21 points, Marcin Gortat had 17 points and 11 rebounds.
Sacramento outscored Phoenix 31-20 in the fourth quarter.
Thornton's 3-pointer gave Sacramento a 112-110 lead with less than a minute to play. He and Tyreke Evans then added two free throws apiece before Frye converted on three free throws with 10 seconds to play.