Phototransistor OpAmp - compensating for ambient light
You don't explain what you want to detect with your phototransistor, but since it's not ambient light I'll presume that you want to detect some kind of data signal.  

For remote control signal reception IR is used so you can use a photodetector which is less sensitive to visual light.  



IR receiver modules also have a bandpass filter around a modulation frequency, often 36 or 38kHz, 



so that the modulator again reduces sensitivity for ambient light, which is often constant, in case of daylight, or quasi constant for incandescent bulbs.
Fluorescent lamps can remain a problem, especially HF (high frequency) lamps which are switched at about 40kHz, right in the receiver's pass band. Relatively speaking they don't emit much IR, but they do emit a lot of energy, so that the IR content may be high after all.  

  

A third measure is a built-in AGC (Automatic Gain Control), which adjusts the receiver's sensitivity based upon the received signal strength. This can often be seen on an oscilloscope image: while there's no signal received the module sees all kind of noise, but as soon as the right signal is detected this noise is suppressed, and only the actual signal remains.



More:
Vishay's offering of IR receiver modules.