Hamels pitches 8 shutout innings, Phils beat Nats