The Phillies will receive two "lower-level minor leaguers," a major league source familiar with the transaction told ESPN.com's Jayson Stark.
Hernandez, 33, is 6-8 with a 3.87 ERA in 23 appearances, 20 of them starts. He will take the place of the ailing Josh Beckett in the Dodgers' rotation and start Friday night against the Milwaukee Brewers.
Beckett (6-6, 2.88 ERA) has been attempting to pitch with a torn labrum in his hip. He was scheduled to have an MRI on Thursday night, and the Dodgers then will decide whether to place him on the disabled list.
"Roberto provides us with another big league starting pitcher, who has pitched well this year, particularly the last seven starts," general manager Ned Colletti said. "He has postseason experience and helps fortify the rotation down the stretch."
Hernandez pitched under the assumed name of Fausto Carmona through 2011 with the Cleveland Indians. He is making $4.5 million this season and will be a free agent in November.
The Dominican Republic native missed most of the 2012 season after getting arrested on charges of falsifying his identity to obtain a visa.
The Dodgers tried to shore up the back of their rotation before the July 31 trade deadline but were unsuccessful in talks involving Jon Lester and David Price because they were unwilling to deal their top three prospects from a slowly improving farm system.
Colletti said he felt confident he would be able to acquire a pitcher after the deadline. He also said Thursday the team may not be done making moves.
"As I've said many times, you better have enough of everything," he said.
Colletti wouldn't identify which pitcher is on his radar, but landing his target likely would require another trade; the NL West-leading Dodgers are currently 30th on the waiver-wire waiting list and 15th among NL teams.
Hernandez likely cleared waivers and will be eligible for the postseason roster should the Dodgers make the playoffs.
Hernandez, who is 6-foot-4 and 240 pounds, is known for his hard sinker, which, according to FanGraphs, he has thrown at an average velocity of 92.5 mph this season.
The Dodgers have one of the strongest trios of starters in the major leagues with Clayton Kershaw, Zack Greinke and Hyun-Jin Ryu but had begun to worry about two aging starters at the back of the rotation. Dan Haren, 33, eased some of those worries with 7 1/3 innings of three-hit ball Wednesday night at Angel Stadium.
Information from Jayson Stark of ESPN.com and ESPNLosAngeles.com contributor Dan Arritt was used in this report.
Dodgers Acquire Roberto Hernandez
Mark Saxon discusses the Dodgers acquiring Roberto Hernandez from the Phillies and what he brings to the team.