Bed, comprising a lower frame (1) and an upper frame (2) with a supporting surface fora mattress, and where the upper frame (2) is connected to the lower frame (1) sothat the upper frame can be raised and lowered in proportion to the lower frame bymeans of one or more adjusting means (5, 6) driven by an electric motor. In order toprevent squeezing between the upper and lower frame when the upper frame is lowered,the bed is provided with anti squeezing means. These comprise a light source anda receiver positioned in a corner of the lower frame. The light source sends a lightbeam which follows the lower frame all the way around and runs just above the topside of the lower frame. When the light beam is interrupted the control unit reactsby cutting off the current for the motors.