An improved phototherapy apparatus for preventing and treating pressure ulcer and other abnormal skin conditions. The phototherapy apparatus comprises a flexible pad which can be built into or placed on top of a bed. A plurality of light emitting diode (LED) or laser light sources and a plurality of pressure sensors are embedded in the flexible pad. Each pressure sensor is associated with one LED or laser light source for monitoring the pressure endured by a specific body area of the patient. When a pressure above certain level is observed, the corresponding LED or laser light source is turned on to provide phototherapy treatment to the pressured area for preventing and treating pressure ulcer and other abnormal skin conditions.