Theory of solvent effects on the equilibrium properties of a diatomic guest molecule