Conventional CCD detectors have two major disadvantages: they are slow to read out and they suffer from read noise. These problems combine to make high-speed spectroscopy of faint targets the most demanding of astronomical observations. It is possible to overcome these weaknesses by using electron-multiplying CCDs (EMCCDs). EMCCDs are conventional frame-transfer CCDs, but with an extended serial register containing high-voltage electrodes. An avalanche of secondary electrons is produced as the photon-generated electrons are clocked through this register, resulting in signal amplification that renders the read noise negligible. Using a combination of laboratory measurements with the QUCAM2 EMCCD camera and Monte Carlo modelling, we show that it is possible to significantly increase the signal-to-noise ratio of an observation by using an EMCCD, but only if it is optimized and utilized correctly. We also show that even greater gains are possible through the use of photon counting. We present a recipe for astronomers to follow when setting up a typical EMCCD observation which ensures that maximum signal-to-noise ratio is obtained. We also discuss the benefits that EMCCDs would bring if used with the next generation of extremely large telescopes. Although we mainly consider the spectroscopic use of EMCCDs, our conclusions are equally applicable to imaging.