Hamels, who is 6-1 with a 2.24 ERA in his past nine starts, limited the Royals to five hits, struck out four and walked three. Hamels (11-2) lowered his ERA to 2.87, which is tied for third in the American League.
The Rangers picked up only their fifth victory in 20 games.
Mazara homered in the fourth with Jurickson Profar, who had walked, aboard, which was the first hit off Royals starter Yordano Ventura. Mazara, who tops all American League rookies with 25 games with multiple hits and 141 total bases, doubled to center in the fifth, scoring Delino DeShields.
Beltre, a career .363 hitter at Kauffman Stadium, hit a three-run homer in the Rangers' four-run seventh off Joakim Soria. Ian Desmond singled in the first run of the inning. Soria has allowed six runs in his past two outings and has a 9.72 ERA in his past nine relief appearances.
Ventura was struck in the right rib cage by a Beltre laser to end the fifth. After Ventura threw to first base, he collapsed to the ground in pain and was attended to by trainer Nick Kenney. X-rays were negative, but Ventura did not come out for the sixth. Ventura (6-8) gave up three runs on three hits and four walks while striking out five.
Cheslor Cuthbert doubled with one out in the first, extending his hitting streak to a career-best 12 games and took third on Mazara's fielding error. Cuthbert scored on Eric Hosmer's groundout for the only run off Hamels.
The Royals scored three runs in the ninth on four singles and a bases-loaded walk before Salvador Perez grounded into a double play to end the game.
RANGERS ADD DUFFY
The Rangers claimed 1B Matt Duffy off waivers from the Astros and assigned him to their Triple-A Round Rock club. Duffy, 27, hit .294 with 20 home runs, 29 doubles and 104 RBI last season with Fresno in the Pacific Coast League. He was hitless in three at-bats this season with Houston.
Rangers: LHP Derek Holland, who is on the 60-day disabled list with shoulder inflammation, threw his first bullpen session, 25 pitches, since going on the DL. If he has no setbacks, Holland could begin a minor league rehab assignment in early August.
Royals: LHP Mike Minor, who had labrum surgery in 2015, threw a simulated game but has yet to pitch in a big league game this season.
Rangers: RHP A.J. Griffin will be working on five days' rest Sunday after a no-decision Monday at the Angels.
Royals: RHP Edinson Volquez is 0-2 with an 8.22 ERA in three career starts against the Rangers, his first club.