The Ubuntu documentation on this is pretty helpful; see here: https://help.ubuntu.com/community/BinaryDriverHowto/ATI
To summarize: first, download the drivers from AMD.
Next, install some packages needed to build from source, if you don't have them already:
sudo apt-get install dh-make dh-modaliases execstack libc6-i386 lib32gcc1
Then, instead of just running the install scripts to install directly, you can build .deb packages instead, by running
sh amd-driver-installer-catalyst-13-4-x86.x86_64.run --buildpkg Ubuntu/raring
You can then install the packages (there should be three of them) using gdebi or synaptic (or the software centre, I suppose), or from the command prompt using
sudo dpkg -i fglrx*.deb
sudo aticonfig --initial (or equivalently - I think -
sudo amdconfig --initial), and then reboot.
If the drivers don't work according to plan, you can remove them as you would other software. (I find this is most easily accomplished using synaptic, and typing fglrx into the search bar, since the software centre doesn't like to let you see "technical" items, or you could run apt-get remove for the file names created when you built the .deb packages.)