You can name anyone you like to be your beneficiary. When you name a beneficiary, you know that your assets will go to the person you choose -- and the assets also bypass probate. If you don't name a beneficiary, the money most likely will become part of your probate estate, and state law will determine who gets it -- which may not be the way you'd want it spent.
You can name anyone as a beneficiary, not just a spouse: Parents, children, siblings, a special-needs niece, close friends, your unmarried partner, or anyone else. If the account administrators accept it, you can also use instructions such as "whoever I'm married to at the time of my death" or "to my grandchildren equally." Usually you can't name a minor child as a beneficiary. Instead, you name a custodian to manage the money for the child until he comes of age.
When there's nobody in your life you want to name as a beneficiary, you can turn your asset into a charitable gift. Your local place of worship will certainly be happy if you donate money at your death. If there's a cause you're passionate about -- saving wildlife, helping abused spouses, feeding the poor -- naming a related group as beneficiary lets you do some good with your money.
When you name your estate as the beneficiary, the payout gets rolled into your other assets and distributed according to your will. This is often what happens when there's no beneficiary named on the account. It's an option, but not a great one: instead of going directly to a beneficiary, money in your estate has to pass through probate, which takes months in some states. If they go through probate the assets may be used to pay your creditors, and they may be subject to estate tax. In some cases, such as if your estate acquires your IRA, your heirs must empty the account much faster than if the assets went to them directly.
Naming a beneficiary isn't irreversible. You can always change your mind later if you get married, have children or simply get a better idea about who deserves the cash. When you don't update accounts, things may go south: If your ex-spouse is still the IRA beneficiary after the divorce, for instance, he may get the money when you die -- although laws vary among states. Reviewing beneficiary designations once a year is a good move. That way, if you forget to update the names after your life changes, you have a chance to fix the mistake.