That depends on the reason for the objection. A spouse may contest the will for objections regarding the validity of the will.
When a spouse is disinherited or would receive a larger portion under the laws that govern intestate estates, that spouse can usually file a claim with the judge for an intestate share depending on the laws in your jurisdiction.