First, it depends upon who is named in the 401(k) records as the beneficiary. Second, it depends upon the intestacy and probate laws of the state in which the spouse died, regarding who (if anyone) has the right to challenge the 401(k) designation post mortem.
There are a number of factors that can affect the ultimate payout. The employer and/or plan administrator would likely have a beneficiary designation on file for the 401(k). If the plan is an ERISA plan, it is unlikely that the interest of the surviving spouse (not the common law spouse) would be usurped. State law can come into play, too (ie, whether the wedded spouses were legally separated, etc.). I know this probably doesn't help, but the question is pretty vague and needs more details, such as was the spouse named as the beneficiary to the 401(k)? was the common-law spouse named as the beneficiary? what do the terms of the 401(k) plan indicate regarding distributions on the participant's death? is the plan governed by ERISA? were the spouses legally separated under state law (ie, did a court issue an order of separation? does state law take away the rights of a surviving spouse when there is a separation order?
wedded
You will have to research your state's particular laws covering this. I am not at all certain that a currently lawfully wedded spouse, can surrender their interests in a will regardless of whatever "financial" agreement may have been reached on other matters.
Penguins have wedded feet so they could swim underwater
Not Wedded But a Wife - 1921 was released on: USA: July 1921
Wedded Blisters - 1928 was released on: USA: 26 August 1928
Wedded Blitz - 1942 was released on: USA: 13 March 1942
The cast of Wedded to Perfection - 2009 includes: Jung Lee as herself
Expedition Journal - 1999 Wedded to the Wild was released on: USA: 1999
Are You Lawfully Wedded
wedded
Cuneiform are wedded shape