Electron beam spectroscopy