Boston will receive minor-league pitchers Heath Hembree and Edwin Escobar in the deal.
Peavy has been pitching better lately after a rough start in Boston this year (1-9, with a 4.72 ERA), and part of the thinking may be that a switch to the National League will help.
Peavy returns to the NL West, where he had his glory days as a San Diego Padre. It doesn't hurt that he is 14-2 with a 2.21 ERA lifetime vs. the rival Dodgers.
The Red Sox's loss to the Rays Friday now drops them on the cusp of falling out of the race, but Boston is strong in starting pitching, so the move doesn't necessarily signal a white flag for Boston.
Hembree, 25, is a right-handed reliever who had a brief call-up with the Giants last season. He is 1-3 with a 3.89 ERA at Triple-A Fresno this season. Escobar, 22, is a lefty starter, also at Fresno with a 3-8 record and 5.11 ERA.
Peavy is said to be content to be going to the Giants at this time after winning a ring in Boston his year there. The Red Sox acquired him at the deadline last year.
The Cardinals also have shown interest in Peavy. Interestingly, the Cardinals announced they had signed A.J. Pierzynski Saturday. Peavy and Pierzynski had teamed together with both the White Sox and Red Sox, but were said to have had an uneven relationship.
In San Francisco, Peavy is reunited with manager Bruce Bochy. Peavy played under Bochy in San Diego from 2002-2006.
FOX Sports first said Peavy was close to going to the Giants.