On the use of electron-multiplying CCDs for astronomical spectroscopy