Electron beam excitation in thin layered samples