Cook pitches Red Sox to 4-2 win over Nationals