Phototransistors operate similar to regular transistors accept that their gates are controlled by the amount of light that hits them. Depending on the phototransistor, more light can either close or open the circuit. In many ways a phototransistor is very similar to a photodiode. Both phototransistors and photodiodes are equally capable of detecting various light levels. Phototransistors however, have longer response times than photodiodes.
Phototransistors were originally developed by Dr. John N. Shive at Bell Labs in 1948. Shive created a bipolar transistor encased within a transparent case. He used the transparent case to allow light to reach the base-collector junction of the transistor. Electrons were generated in the junction by the photons that entered it. The electrons were then injected into the base, and this photodiode current is amplified by the transistor's current gain. The creation of the phototransistor was not announced until 1950.
More information on basic transistors can be found here: