You can't adjust the gain of the phototransistor, but you can adjust the gain of whatever circuit interprets its signal. The usual way to do this would be to provide enough amplification for the maximum gain you want, then use the pot as a adjustable voltage divider to attenuate somewhere in the signal path.
You probably want to have one gain stage with some minimum gain that acts like a buffer before the attenuator pot, then the remaining part of the fixed gain after that. This way neither the phototransistor or whatever uses the output of the overall circuit see any changes in impedance and the like as the gain is adjusted.