A phototransistor is a 3-layer semiconductor device that detects light and changes the flow of electric current accordingly. It consists of a light-sensitive base region and operates based on the photoelectric effect. Phototransistors are constructed from materials like silicon, germanium, gallium, or arsenide and detect light falling on the base-collector junction. When light hits the base, electron-hole pairs are generated, causing current to flow from emitter to collector. Phototransistors are commonly used for light detection, controlling light levels, and in counting and punch card reading systems due to their light sensitivity and ability to operate as a photodiode and transistor.