Physics of the outer atmosphere of the Sun and of stars along their evolutionary track