SEATTLE (AP) — Cole Hamels shook off a line drive that deflected off his left shoulder, and the Texas Rangers homered four times to beat the Seattle Mariners 9-6 Tuesday night.

Hamels pitched seven innings to help Texas move within one game of first-place Houston in the AL West. The Astros lost 4-0 at Oakland.

Mitch Moreland, Shin-Soo Choo and Rougned Odor connected off Mariners starter Taijuan Walker, who lasted just three innings.

With two runners aboard in the third, Jesus Sucre lined a 1-0 pitch straight back to the pitcher's mound. Hamels (3-1) managed to deflect the ball with his glove before it slammed into his shoulder, causing the left-hander to stumble and fall to the ground.

After being checked by the Rangers' staff, Hamels remained in the game and got out of the jam with just one run allowed on a fielder's choice by Kyle Seager.