You can setup your Mac to restart automatically when it freezes using a new feature in Mac OS X Lion. Select “Energy Saver” option from System Preferences, tick the “Restart automatically if the computer freezes” option.
A common cause of computer freeze is spoilt RAM memory. A Mac that freezes is unusual and if you encounter random freezes and crashes, there probably is some defect in the hardware. It’s then time for a visit to Apple support.