A very small case containing a drop of mercury that can move freely. In certain positions, the mercury connects two metal electrodes closing a circuit.
A mercury switch can be used to detect acceleration, or to notice if a device is being held in some specific position. For example, a digital camera could notice if it is being used to shoot in the horizontal or the vertical format. Space heaters use mercury switches to turn off if they have been tipped over.
Since mercury is polluting, there is a move towards ball switches; nonetheless, mercury is more sensitive to small movements, and it can conduct larger currents.
The reliable m_turner also observes that, due to the impressive thermal expansion coefficient of mercury, mercury switches can be used to build a thermostat (in opposition to the more normal bimetallic type); by varying the tilt of a properly shaped and oriented mercury switch you can have it close a circuit at different temperatures.