Utility functions are nonlinear with decreasing slope. When you don't have enough money to buy everything you want, you buy the most important things first. A 50% chance of gaining 2x dollars is a worse deal than a 100% chance of gaining x dollars, with the difference in utility becoming more significant percentage-wise for larger x.
This rant used to conclude with "therefore, buying lottery tickets is irrational; period", but someone on Less Wrong recently brought up a valid exception: it can be rational if you're currently deeply in debt. Utility functions are actually sigma-shaped: they flatten as you get more deeply negative as well. Being two trillion in debt isn't very much worse than being one trillion in debt. So when you're in debt, your utility function can get steeper before it gets shallower.
I think it's a lot more complicated than the diminishing-marginal-returns model taught in econ courses. For example, there's a pretty sharp discontinuity at "can move to a better neighborhood". There's another one at "can afford a vacation home", and another one at "can send kids to college". And then there's a big one at "never has to work again." When an event bumps you from one category into the next one up, it can often be rational to take a small chance at that rather unlikely event than to worry about a few dollars that don't make a material difference in your lifestyle anyway.
Actually, this is a big problem with conventional economics: it assumes that all variables are conventional. So income taxes don't affect people's willingness to work nearly as much as theory predicts, because their choice is usually between "Have a job" and "Don't have a job" and not "Do $30K of work per year" and "Do $40k of work per year". Unemployment exists because a business can't just drop wages to the equilibrium level, but rather workers make the choice between "I'm being paid fairly" and "I'm not being paid fairly" and act appropriately. Market niches are not instantly filled because entrepreneurship often has a binary outcome of "Get rich" and "Fail", and not a continuous distribution of outcomes.
This rant used to conclude with "therefore, buying lottery tickets is irrational; period", but someone on Less Wrong recently brought up a valid exception: it can be rational if you're currently deeply in debt. Utility functions are actually sigma-shaped: they flatten as you get more deeply negative as well. Being two trillion in debt isn't very much worse than being one trillion in debt. So when you're in debt, your utility function can get steeper before it gets shallower.