J.D. Davis homered on the first pitch from Maurico Llovera in the ninth inning to give the San Francisco Giants a 3-2 victory over the Boston Red Sox on Saturday night.