To gain more control over this -
- Install dconf editor. This is available on Ubuntu software centre as well
- Open the dconf editor (terminal > type dconf-editor)
- Navigate to org > gnome > settings-daemon > plugins > power
- Set the critical-battery-action option as required.
Edit: This option works for Ubuntu 12.04 (Precise Pangolin) and Ubuntu 12.10 (Quantal Quetzal) as well.