The Mars Exploration Rover cannot function well under excessively hot or cold temperatures. In order to survive during all of the various mission phases, the rover's parts must be in temperature range of -40º Celsius to +40º Celsius.
The rover's batteries, electronics, and computer are housed inside a Warm Electronics Box (WEB). Heaters are packed inside the rover body and the WEB walls help keeps the heat in when the night temperatures on Mars can drop to -96º Celsius. The rover's body also releases excess heat through its radiators.
There are several methods engineers used to keep the rover at the right temperature:
The body of the rover is painted with a gold coating from the outside. This reflective coating prevents transfer of heat in the rover to the surroundings.
The rover is also kept warm by a special layer of insulation, called solid silica aerogel. This material prevents heat from escaping outside of the rover body walls. Aerogel traps heat inside the rover body. It is a unique silicon-based substance nicknamed "solid smoke" because it is 99.8% air. Aerogel is one thousand times less dense than glass, so it is extraordinarily lightweight, which makes it much cheaper and easier to launch and fly to Mars.