With the victory, the Warriors ended a three-game slide. They suffered through an 0-3 Eastern Conference road trip that included an overtime loss at Milwaukee and a defeat at Detroit on a buzzer-beating three-pointer.
The Warriors took out their frustrations on the Suns, pulling to within 2 1/2 games of the eighth and final playoff spot in the West.
"After the Milwaukee game, I stayed up all night and watched the film," said Golden State Coach Eric Musselman. "I was devastated that we lost that game. However, I keep getting back to how they bounced back. After seeing their faces in Detroit, I knew they weren't going to cave in."
Antawn Jamison led the Warriors with 23 points, and Gilbert Arenas scored 14 of his 22 points before halftime. Jason Richardson sparked a 15-6 surge that closed the first half with a three-pointer and a three-point play that provided a 64-52 halftime cushion.
The Warriors scored the first nine points of the fourth quarter, including six by Foyle, for a 93-73 cushion. Golden State led by at least 18 points the rest of the way.
"We're just going to keep fighting," Arenas said. "You can't just come here and think you are going to get a win."
Rookie Amare Stoudemire scored 24 points to lead Phoenix, which lost for the ninth time in 13 games. The Suns, who saw three players pick up technicals, lead Houston by one-half game for eighth place in the West.
"They have a lot of guys who can board the ball and get their offense running," Stoudemire said. "We were in the game, but in the last two minutes of the second quarter, they made a run and started the third the same way."
Golden State notched its 31st victory in its 64th game, the most wins for the franchise since a 36-46 campaign in the 1995-96 season. The Warriors have won five straight home games, and league-leading Dallas visits on Friday.
Troy Murphy collected 13 points and 12 rebounds, and Jamison grabbed 11 rebounds as Golden State held a commanding 58-41 edge on the glass. Foyle had 10 offensive rebounds, and the Warriors had 22 second-chance points.