Theory of up-conversion of frequency in gases under twophoton resonance conditions