Terms of the contract were not disclosed but the deal is reportedly worth $1 million for one year.
The 37-year-old Martinez went 5-6 with a 5.61 ERA for the New York Mets last year. The free agent pitched in the World Baseball Classic before this season.
The defending World Series champion Phillies have been hurt by injuries to their starting rotation. No. 2 starter Brett Myers had hip surgery in June. Antonio Bastardo, who replaced Myers, landed on the disabled list after making five starts. The NL East leaders already have used nine starters through 86 games. They used only seven starters last season.
Martinez is 214-99 with a 2.91 ERA in 17 seasons with the Los Angeles Dodgers, Montreal, Boston and the Mets. He helped the Red Sox win the World Series in 2004.
Adding Martinez isn’t expected to prevent the Phillies from pursuing All-Star Roy Halladay. The Toronto Blue Jays are actively seeking to deal the former AL Cy Young Award winner, and Philadelphia already has expressed strong interest.