I'm using an N5040 right now......one that I have had similar things happen. On one occasion, I had changed the boot order to boot first from USB, then from hard disk. Once I changed it back it stopped the black screen/beeping.
You may also be having hard drive problems. If you have a spare hard drive try switching it out and see if the problem is resolved.
Another possibility is that it is overheating. I have had laptops to freak out on me before because of overheating. If you think this is a possibility, make sure the computer is on a hard, flat surface that allows it to "breath" easily.
Without actually seeing the computer that's all I can think of at the moment, but those three things are definitely worth checking out.