The first one seems to be a system crash. You will have to check the system logs to see what exactly happened .In fedora I would have checked /var/log/messages. May be its the same for Ubuntu.
For the second issue, I guess you leave your firefox on when you are away (What made me guess this? Your first issue, the way you described it, the fact that u use Ubuntu... ). I have noticed that npviewer (a flash plugin) misbehaves a lot. You can try killing firefox and npviewer.bin to see if your system comes back to normal state.
When you see something is taking up lot of cpu, start a terminal program and run 'top'. Press, l. It will show you the process that use a lot of CPU. Press m, it will show you processes that use a lot of memory. Look for the 'PID' of the process that is taking all your resources. Issue the command 'kill -9 <PID of the process>'. (In Ubuntu, you will be logged in as a normal user. So the chances are less that you will kill any important system process.)
Btw, press 'q' to exit top.