Electronic devices at the nanoscale have reached such small dimensions that scanning probe techniques are critical for their characterization. Understanding the operating mechanisms of nanoscale field effect transistors, quantum point contacts, and nanowire sensor devices all require nanometer-resolution electronic measurements. Of the scanning probe techniques frequently used, however, few provide the energy-dependent information that clearly illuminates device operation. Tunneling spectroscopy, while enormously successful, is severely limited for field effect devices built upon insulating oxides. Our research has therefore focused on atomic force-based electrical characterization, such as Kelvin force microscopy, electrostatic force microscopy, and scanning gate microscopy (SGM), and specifically attempts to extend these techniques towards true spectroscopies. Here we describe an energy-resolved version of SGM named scanning gate spectroscopy (SGS). In traditional SGM, a conductive AFM probe is used as a source of localized electric fields that can gate a device or change its conductance. By correlating conductance changes with probe position, SGM produces qualitative maps of device gate sensitivity. The new SGS technique operates in a similar manner but continuously varies the electrostatic potential of the probe. The gating characteristics of the entire device are mapped out both spatially and electronically, revealing the energy-dependent effects of local defects and inhomogeneities. For example, the difference in scattering as particular sites move into and out of resonance with the Fermi level becomes straightforward to observe; even more importantly, the SGS mapping return quantitative information that enables accurate modeling of device operation. We apply the technique to carbon nanotube field-effect transistors (CNTFETs), which are an ideal test case because of they have multiple, independent mechanisms of gate sensitivity. A typical CNTFET might have a semiconducting bandstructure, a Schottky barrier contact, and one or more defect sites, all of which are gate sensitive under different conditions. The SGS technique clearly distinguishes between these three mechanisms and provides new information about each, enabling us to build a transmission model specific to different types of defects, for example.