Halladay doubled over and was visited by a trainer after Starlin Castro led off the fifth inning with a single. Drew Carpenter came in to replace him.
Halladay was drenched in sweat on a humid night in which the game-time temperature was 91. The heat clearly affected him. He gave up three runs and seven hits and took his first loss since May 15. Halladay had his first outing since starting for the National League in last week's All-Star game and pitching two perfect innings.
This was Halladay's shortest outing since he pitched three innings for Toronto against Florida on June 12, 2009, and it ended a string of 63 road starts in which he lasted at least six innings. It was the longest such streak since Walter Johnson went 82 straight road starts from 1911-15.
Ramirez gave the Cubs a 1-0 lead in the first when he drove his 17th homer - and 12th in 23 games - to the basket in left-center field.
Chicago added two runs in the third when Lopez led off with a single and scored on Ramirez's bases-loaded sacrifice fly to deep right. Pena then lined a single, making it 3-0.
Lopez gave up a leadoff homer to Jimmy Rollins in the fourth after retiring the first nine batters, but that was all the scoring he allowed.
He gave up five hits and left to loud cheers, tipping his cap as he headed to the dugout after John Mayberry Jr. singled with two outs in the seventh.
The Cubs got RBI doubles from Darwin Barney and Kosuke Fukudome in the sixth, and another run in the seventh when Pena drove his team-leading 20th homer out to center, making it 6-1.
Embattled closer Carlos Marmol worked the ninth after being shut down following two brutal outings against Florida on Thursday and Friday. He issued two-out walks to Carlos Ruiz and Domonic Brown before striking out Mayberry to end the game.
Notes: Phillies manager Charlie Manuel wouldn't say if OF Shane Victorino, out with a sprained right thumb, will be activated from the 15-day disabled list when he's eligible on Tuesday. Manuel said Victorino still needs to be cleared by doctors. ... Manuel said before the game that RHP Ryan Madson, who returned from a bruised right hand on Friday, needed "at least one" more appearance before returning to the closer role. ... Cubs manager Mike Quade said he hadn't heard from Major League Baseball about his postgame rant against the umpires on Sunday. Quade let loose after a 7-5 loss to Florida, saying the umpires made unprofessional comments to his players. He took issue in particular with one call at second base in the top of the eighth. The Cubs thought they had picked off Brett Hayes, but umpire Lance Barrett called him safe. Hayes went on to score the go-ahead run. "I obviously disagreed with a few calls," Quade said. "It was a rough series in a lot of different ways. It was frustrating." Quade added he has "all the respect in the world" for the umpires. ... Ramirez again made it clear he's not waiving his no-trade clause. "Right now, I'm not interested in a trade," he said. ... Pena's homer was his 250th.