The blue screen (assuming you use XP) is usually caused by a hardware problem, Try removing all unnecessary hardware (printers, scanners, webcams, basically everything except for your monitor, mouse, keyboard, and speakers) and use your computer for a while. If this does not work, you can immeadiately rule out the devices themselves. The next problem could be a dodgy driver or a problem with one of your cards (video card, sound card, etc.) Out-of-date drivers can do this, so update all of your drivers from the internet.
However, the sudden cutting out and rebooting suggests to me that there is a problem with your PSU (power supply unit) or anything that would have a safety cut-out (due to large currents, over-heating, etc.) This is a problem I personally would have a professional look at (I am more of a software-orientated computer-geek, although I would not say I know little about hardware; I would say quite the contrary.)
Another suggestion may be that the two are not linked, but rather a coincedence, or the power cut off whilst a certain peice of hardware was being used, corrupting the driver and causing your "Blue Sceen of Death."
If you are not using XP, blue screens are to be expected regularly, Microsoft's previous operating systems weren't the most stable on the market. However, if the computer cuts off completely (i.e. switches off or instantly restarts with no warning or logging off) then your problem is certainly not software-related. If you get warnings such as "Computer shutting down in 30 seconds" then it is probably a virus, but I highly doubt that is your problem.
Summary: Get your PC seen to by an expert, the problem sounds like a dodgy PSU or board inside the machine, and possibly external hardware as well. And don't worry about viruses - they can NOT turn the power off instantly as you described, so it is not a virus problem.