OS X displays weird pattern randomly freezes and shuts off
The problem you are describing is a problem I had a while ago as well. For me the screen would get all messed up and depending on whether I was playing sound at that moment or not I would hear a loud screaming-like sound. Then after a couple of seconds the computer would reboot.

Replacing the ram fixed it for me.