The Phillies rebounded from Thursday night's 6-4 loss to Houston, which broke a seven-game winning streak and left them four games back for the second NL wild-card spot.
Rollins' homer keyed a four-run first inning on a night when the Phillies came one run shy of a season high.
A two-run homer by Matt Downs got Houston within 5-3 in the fourth. Mayberry's two-run single in the fifth stretched the lead to 7-3.
Justin Maxwell added a solo shot in the fifth for the last-place Astros.
Cole Hamels (15-6) gave up four runs and seven hits over seven innings, and tied a career high for wins set in 2007. It was the first victory over the Astros for the left-hander in his last five tries, and his first win overall since Aug. 18 after not factoring into the decision in his last three outings.
Hamels threw 95 pitches, ending a streak of 14 straight games with at least 100 pitches.
Edgar Gonzalez (2-1), starting in place of Bud Norris - scratched on Thursday because of a blister on the index finger of his throwing hand - needed 32 pitches to get through the first inning and was done after the fourth.
Brown's homer, to the second deck in right field, made it 9-4 in the seventh.
After Rollins homered into the right-field seats for his 42nd career leadoff shot, extending his team record, Juan Pierre drew a walk, stole second base and scored on a single by Chase Utley. Utley swiped second base before making it 3-0 when he scored on a ground-rule double by Howard. Mayberry's two-out RBI single left the Phillies up 4-0.
Mayberry, who finished with three hits, doubled in the fourth and scored on a single by Kevin Frandsen to push the lead to 5-1.
Chuckie Fick walked Utley and Howard with one out in the fifth before being lifted for Fernando Rodriguez. After an intentional walk to Brown loaded the bases, Mayberry's single was deflected by Rodriguez and rolled to second baseman Jose Altuve. Utley and Carlos Ruiz scored before Altuve could get the throw to the plate and the Phillies increased the lead to 7-3.
Utley had an RBI double in the eighth and Howard drove in two runs with a single.
NOTES: Jeff Kent, who played for the Astros from 2003-04, was scheduled to throw out the first pitch on Friday as Houston continues the celebration of the 50th anniversary of the franchise. But Kent was still recovering from breaking four ribs and puncturing one of his lungs in a recent dirt bike accident, so his 9-year-old son Kaeden threw the pitch. Kent is set to appear "Survivor: Philippines," the 25th season of the show, which premieres later this month. "The opportunity came for me to challenge myself and compete and compete socially, which was a challenge in itself," he said of the show. "It was a fun experience." ... Ruiz was the only player in Philadelphia's lineup without a hit Friday.