That gives the franchise four of its potential free agents under contract for 2011 before the collective bargaining agreement is set to expire Thursday night.
Lawson, a five-year pro, made 59 tackles and added 2.5 sacks and one interception. He could become an unrestricted free agent under a new CBA.
Goldson, a four-year pro, started all 16 games, making 80 tackles and one sack and adding one interception, which he returned for a touchdown.
McDonald, a four-year pro, made 19 tackles and was a situational player in the defensive line rotation.
Spillman appeared in 11 games for the 49ers after being claimed off waivers from the San Diego Chargers in October. The three-year veteran ranked second on the team with 21 special-teams tackles and saw limited action on defense, where he registered one stop.
The Associated Press contributed to this report.