First off, you should download the Emacs 24.4 source tarball:
cd ~
mkdir emacs-src && cd emacs-src
wget http://mirror.team-cymru.org/gnu/emacs/emacs-24.4.tar.gz
tar xvf emacs-24.4.tar.gz
Now, you want to compile the Emacs binary.
sudo apt-get install build-essential
sudo apt-get build-dep emacs24
cd emacs-24.4
./configure
make
sudo make install
If the system complains about any dependencies, just manually install them.
Sources: (Ubuntu Handbook) and @namingFailed's comment.
If you want to be nice to the community, you could always maintain your own PPA with Emacs 24.4 in it. That's another question, however. I might bring one of my own up later...