Excitation and quenching of the oxygen bands in the nightglow