Penny's one-year contract is worth $7.5 million and contains $1.5 million in performance bonuses, according to sources. The deal is pending a physical, which will likely be done on Tuesday.
Penny recently turned down a one-year offer to stay with San Francisco. The two-time All-Star quickly drew interest from the NL Central champion Cardinals, facing the loss of free-agent pitchers Joel Pineiro, John Smoltz and Todd Wellemeyer.
Penny went a combined 11-9 with a 4.88 ERA in 30 starts for Boston and the Giants last season. He won a career-high 16 games in 2006 and 2007 with the Los Angeles Dodgers and was an All-Star both seasons. He was slowed by shoulder trouble in 2008.
The Red Sox signed Penny to a $5 million, one-year contract during the last offseason. He never found his rhythm with Boston and went 7-8 with a 5.61 ERA.
Penny went 1-6 in his last 11 starts for the Red Sox, and they cut him in late August. He joined the Giants, who were still in the wild-card race, on Aug. 31 and found his old form back in the National League.
Penny was 4-1 with a 2.59 ERA in six starts for San Francisco. He is 105-84 lifetime and won twice for Florida in its 2003 World Series victory over the Yankees.
The Cardinals won their division behind big years from aces Chris Carpenter and Adam Wainwright and a fine season from Pineiro. Smoltz made seven starts after being released by Boston and Wellemeyer made 21 starts during an injury-interrupted season.
Information from The Associated Press contributed to this report.