The invention relates to a lamp, comprising a light source for generating a light beam in the direction of a main axis and a first direction-dependent tilt switch for controlling the light source depending on the angle between the main axis and the vertical, wherein the switching direction of the first tilt switch extends in a main plane which runs along the main axis. This enables the use of a tilt switch which functions in only one direction and has a much simpler construction than a switch which functions in two dimensions, such as in the prior art. Furthermore, such a switch has the advantage of a small volume, which advantage is also realized when more switches are used in the lamp. According to another preferred embodiment, the lamp comprises a housing and the housing is provided with marking means for marking the position of the lamp in which the main plane extends vertically.