Line formation in pulsating variable stars