Updated

CHICAGO (AP) — Aramis Ramirez homered with two outs in the bottom of the eighth Friday for his third hit of the game and the Chicago Cubs rallied for a 4-3 victory over the Philadelphia Phillies.

Ramirez appears to be coming out of a season-long slump. His 11th homer came off Ryan Madson (2-1). It cleared the bleachers in left field and gave him 14 RBIs in his last eight games.

Sean Marshall (6-2) pitched the eighth in relief of Ted Lilly and Carlos Marmol struck out the side in the ninth for his 17th save in 20 chances.

Ryan Howard hit his 20th homer with two outs in the sixth, a drive onto the roof of a batter's eye seating section in straightaway center. It was his third home run in two games and it put the Phils up 3-1.

After Howard's blast, the Cubs rallied for two in the bottom of the inning with a two-out rally of their own off Joe Blanton as Ramirez doubled and Marlon Byrd followed with his 10th homer, tying it at 3.

Shane Victorino also homered for the Phillies off Lilly on a 90-degree day at Wrigley Field.

Blanton pitched seven innings and gave up five hits and three runs with three walks while tying a season-high with eight strikeouts.

Lilly, who can be a free agent after the season, has been the subject of numerous trade rumors and met Thursday with general manager Jim Hendry to discuss his Cubs' future.

"He wants to stay here. ... And we'd like for him to stay here," Cubs manager Lou Piniella said before Friday's game. "At the same time, you never know what is going to happen."

And after two shaky starts in which he gave up 14 earned runs and 18 hits, Lilly retired the first 10 batters he faced before surrendering Victorino's career-best 15th homer with one out in the fourth.

Lilly's final line was similar to Blanton's. He surrendered three runs and four hits in seven innings with a walk and a season-high 10 strikeouts.

Cody Ransom and Carlos Ruiz had back-to-back singles with one out in the fifth before Lilly got called third strikes past Wilson Valdez and Blanton.

Chicago tied the game in the fifth when Blanton walked Lilly, who was hitless in 26 at-bats this season, on a 3-2 pitch with two outs and the bases loaded.

Ramirez singled and Soriano walked before Blanton intentionally walked Geovany Soto to load the bases and face Lilly.

NOTES: Victorino hit 14 homers in 2008. ... Jayson Werth was called out on strikes three times.