Hamilton was in a 5-for-41 slump with 18 strikeouts but hit two sacrifice flies and then singled in the Angels' final run in the ninth inning.
The Angels' seventh win in eight games put them 1 1-2 games ahead of Oakland but it was costly. Right-handed starter Garrett Richards sustained a patellar injury in his left knee while running to cover first base in the second inning. The extent of the injury wasn't known.
Richards, 7-2 in his previous 11 starts, left after 1 2-3 innings with a 2-0 deficit. Boston made it 3-0 on David Ortiz's homer in the third off winning pitcher Cory Rasmus (3-1).