Thornton's $20.25 million deal will see him earn $6.75 million, per season, while Marleau's deal worth just over $20 million will see him make $6.667 million, per year.
"Patrick and Joe continue to perform at an elite level in the National Hockey League and, most importantly, they make the other players around them better," Sharks GM Doug Wilson said in a statement. "They both made it very clear that they wanted to stay in San Jose and we were able to agree on contracts that fit with our team building philosophy."
Entering play today, Thornton leads the NHL in assists with (47) and is tied for sixth in scoring with 53 points.
In 1,176 career NHL games with Boston and San Jose, Thornton has posted 1,171 points (337 goals, 834 assists), the most of any NHL player since Thornton entered the League in 1997-98.
Marleau is tied for 14th in the NHL in goals (21) and tied for 18th in scoring (47 points).
In 1,216 NHL games, all with San Jose, Marleau has notched 908 points (425 goals, 483 assists). Over the last six seasons, he has scored the fourth-most goals in the NHL (187), behind only Alex Ovechkin, Steven Stamkos and Corey Perry.