Brandon Allen hit a two-run pinch-hit homer in the ninth and the Tampa Bay Rays beat the Los Angeles Angels 4-3 on Thursday.

Albert Pujols went 1 for 4, ending his hitless streak at 21 at-bats when the Angels' slugger rolled a grounder up the middle to beat the Rays' three-man defensive shift. He was thrown out attempting to stretch the single into a double.

Pujols' hitless streak was the longest of his career, surpassing a 0-for-18 stretch from Aug. 29-Sept. 4, 2010.

Pujols, with 445 homers, has not gone deep in 19 games this season, a span of 76 at-bats. Dating back to last Sept. 22, Pujols has not hit a home run in 105 at-bats, which ties his longest regular-season drought, which took place from April 23-May 23, 2011.

Allen, recently acquired off waivers from Oakland, homered off closer Jordan Walden (0-1) after B.J. Upton had a one-out single. Allen drew a bases-loaded walk off the bench in Wednesday night's 3-2 win over Los Angeles in his first Tampa Bay plate appearance.

Brandon Gomes (1-0) worked a 1-2-3 ninth, helping the Rays win their fifth straight game.

Jerome Williams pitched seven solid innings and Mark Trumbo homered and had two RBIs for the Angels, who have lost seven of nine.

Williams allowed two runs and five hits. Trumbo hit his third homer this season in the fifth, and added an RBI double one inning later.

Ben Zobrist and Matt Joyce drove in the other Rays' runs. Matt Moore gave up three runs and five hits in 5 2-3 innings.

The Angels had just one base runner — Vernon Wells' second-inning walk — through four against Moore. Trumbo opened the fifth with a towering homer to left that tied it at 1.

After Trumbo hit a two-out, run-scoring double, he scored on Wells' infield single that put Los Angeles ahead 3-1 in the sixth.

Tampa Bay got within 3-2 when Joyce drove in a run with a triple during the bottom of the sixth.

Desmond Jennings had a leadoff single in the first and scored for a 1-0 lead when Zobrist doubled. Jennings has a career-best eight-game hitting streak.

Notes: Williams' only other start against Tampa Bay came on June 8, 2004, while with San Francisco. He picked up the win after allowing one run over seven innings. ... Los Angeles RHP Jered Weaver (3-0), who is 12-0 with a 1.84 ERA in 14 starts before May 1 since 2010, will go against Cleveland RHP Justin Masterson (0-2) on Friday night. ... Rays RHP James Shields and Texas LHP Matt Harrison, both 3-0 this season, are Friday night's scheduled starters.