I was surprised to see how wrong the entries on the Internet were about changing the default OS that grub boots into. Here are the correct instructions for how to do this (it has been tested on ubuntu 9.10).

sudo gedit /etc/default/grub

Then change the GRUB_DEFAULT=0 line to the number that you want to boot. i.e. if you are trying to boot into the 5 entry in the grub bootloader, put 5. You can also change the number of second grub will wait before booting using GRUB_TIMEOUT.

Then you need to update grub:

sudo update-grub

If you see something like this, congrats! You did it!

Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.31-17-generic
Found initrd image: /boot/initrd.img-2.6.31-17-generic
Found linux image: /boot/vmlinuz-2.6.31-14-generic
Found initrd image: /boot/initrd.img-2.6.31-14-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
done

Reboot to see the changes.