In a piece called "Lottery-itis!," Goldbart and co-author Joan DiFuria wrote on their blog last year on the Psychology Today website that in times of economic stress, playing the lottery is a way of coping with financial anxieties and uncertainty.
"We may seek a magic pill to make us feel better," they wrote. "Ah yes, buy a lottery ticket. Feel again like you did when you were a child, having hope that a better day will come, that some big thing will happen that will make everything right, set the course on track. "
The Mega Millions jackpot soared to $586 million on Monday, still short of the $656 million U.S. record set in a March 2012 drawing. The new huge prize stems from a major game revamp in October that dramatically reduced the odds of winning. If no one wins Tuesday night and the jackpot rolls over past the next drawing scheduled Friday, it will reach $1 billion, according to Paula Otto, executive director of the Virginia Lottery and Mega Millions' lead director.
Between 65 and 70 percent of roughly 259 million possible number combinations will be in play when the numbers are drawn, Otto says. For the ticket-buying optimists, that's no deterrent.
(Read more: Lottery winners need a financial plan)
"Even though the odds are against you, it's just the excitement of, 'Hey, I might wake up one day and be a millionaire,'" says Chris Scales, a 31-year-old hot dog vendor in downtown Nashville, Tenn., who brings in about $35,000 a year "if I really hustle." He usually reserves his lottery playing for jackpots of at least $40 million.
The incredibly remote odds don't really sink in for people, says George Loewenstein, a professor of economics and psychology at Carnegie Mellon University who has researched the motives underlying lottery ticket purchases.
"People don't really understand probabilities at all," he says. "Once you have a bunch of zeroes, it doesn't matter how many you have—one in 10,000, one in a million or one in a billion. ... People do understand the meaning of the word 'largest.' They overact to one dimension and underreact to the other."
They also cling to a more romantic notion: Amazing things happen to others, so why not for me?
"When people are desperately sick, there's always a part of the brain that thinks there will be a miracle cure," Loewenstein says. "If you want something to be true, your brain is awfully good at figuring out reasons, magical ones, that there's a good likelihood that it is true. The desire to win does drive a certain kind of frenzied optimism."
That frenzy can grow during the holiday season, when financial hardships become more glaring and people feel pressure to spend money they don't have to demonstrate their love. "If you have plenty of money in the bank, you're not likely to feel the need to buy a lottery ticket," Goldbart explains. "But if there's something missing financially and emotionally and you're thinking, 'I can't get a raise or I'm not likely to get another job,' you buy a ticket as a psychological compensation plan."
(Read more: Mega Millions jackpot soars toward $656 million record)