Colors of reflection nebulae. II. The excitation of extended red emission