Theory of photogeneration and fluorescence quenching