Werth's 29th homer began a six-run Philadelphia' explosion in the first inning that was capped by Ruiz's shot.
Martinez (2-0) gave up four runs and seven hits in six innings.
New York's Angel Pagan hit two solo homers -- one an inside-the-park shot in the first.
Luis Castillo and Daniel Murphy had three hits and one RBI each.
The losing pitcher was Oliver Perez (3-4).