ST. PETERSBURG, Fla. -- Roberto Hernandez started looking like the rest of the Tampa Bay Rays' rotation just before he is removed from it.
Hernandez came within one out of a complete-game shutout Tuesday at Tropicana Field but otherwise stifled the Arizona Diamondbacks in a 5-2 victory that improved the Rays to 21-4 in July.
Rays manager Joe Maddon said he still plans to go to a four-man rotation in August, meaning Hernandez is headed to the bullpen. But the right-hander showed he belonged with the rest of the Rays' stellar starting staff, at least for a night.
Unlike some of his other starts this season, he remained composed despite early trouble -- he hit the first batter and then allowed a single to Aaron Hill -- and improved throughout, retiring 22 of the next 25 batters he faced, 15 on ground balls.
"There were days he threw the ball better, but results-wise, this was his best," catcher Jose Molina said. "Very, very special."
Hernandez concurred, saying he felt "very great."
Hernandez allowed just five hits -- two by Hill -- in his first complete game of the season and struck out six to improve to 6-11. He was threatened briefly in the ninth, when Gerardo Parra singled and Eric Chavez clanked his eighth home run off the right-field foul pole.
"It's unfortunate he lost the shutout on the home run there," Maddon said, "but you cannot lament any of that."
Ben Zobrist and Yunel Escobar each knocked in two runs for Tampa Bay (64-43), which has gained nine games in the standings with its torrid run, clinched its best month ever and is producing the best record in July since the 1941 New York Yankees (25-4).
Arizona (54-52) lost its third straight.
"(Hernandez) threw a good game," Arizona manager Kirk Gibson said, "but we weren't able to capitalize on anything at all."
Hernandez's complete game was the Rays' seventh this month, the most since the 1999 Phillies.
Tampa Bay took a 2-0 lead in the second inning with the help of two doubles off Diamondbacks starter Ian Kennedy (3-8). Desmond Jennings led off with a hustle double on a line drive into the left-center alley. He scored easily on Zobrist's single to right for a 1-0 lead. Evan Longoria reached on a fielder's choice and beat a throw home with two out when James Loney banged a double off the wall in right-center.
Escobar's eighth home run of the season gave the Rays a 3-0 lead in the fourth inning.
Kennedy failed in his 10th try at his 50th career win, allowing three earned runs on six hits and three walks in five innings. He struck out seven but fell to 1-4 with a 6.46 ERA against the Rays.
"I threw a lot of pitches there in the last inning," Kennedy said. "Obviously, I wanted to go back out, but I think I threw about 30-some-odd pitches in that last inning," Kennedy said.
Tampa Bay added another run off Will Harris in the sixth as Matt Joyce led off with a walk, advanced to third on a perfectly executed hit-and-run by Jose Molina and a wild pitch, and scored on Escobar's fly-out to right field.
Zobrist's RBI double improved the lead to 5-0 in the eighth.
NOTES: The game was delayed for 20 minutes in the bottom of the second inning when a lightning strike at a substation serving Tropicana Field caused several banks of lights to go dark. ... The Rays have won a club-record 10 consecutive series, the longest by a major-league club since the 2009 St. Louis Cardinals won 10 in a row. ... Tampa Bay entered a slate of 10 consecutive games against National League teams with the best interleague record in the majors (9-1). ... MLB.com reported Tuesday that the Diamondbacks were close to acquiring RHP Jake Peavy from the White Sox before the trade deadline, but Gibson told a Phoenix-area radio station, "I was just informed (by the media) that we were the front-runner, but I walked out of the room at noon, and I hadn't heard his name in two days." Peavy is 8-4 with a 4.28 ERA in 13 starts, but the Diamondbacks expect to soon have RHP Brandon McCarthy (right shoulder inflammation) and RHP Trevor Cahill (right hip contusion) back from injuries. ... Rays rookie OF Wil Myers extended his hitting streak to 11 games. ... RHP Alex Cobb threw a 50-pitch simulated game on Tuesday and is scheduled to pitch three innings Saturday for Class A Port Charlotte (Fla.). He hasn't pitched for Tampa Bay since sustaining a concussion after being hit in the head by an Eric Hosmer line drive on June 15. ... Longoria's 11-game hit streak ended in an 0-for-5 night.