With a simple and physically intuitive method, first-principles calculations of potential-energy surfaces are performed for excited states in a number of illustrative systems, including dimers (H(2) and NaCl) and gas-surface systems [Cl-Na(100) and Cl(2)-Na(100)]. It is based on density-functional theory and is a generalization of the Delta self-consistent field (DeltaSCF) method, where electron-hole pairs are introduced in order to model excited states, corresponding to internal electron transfers in the considered system. The desired excitations are identified by analysis of calculated electron orbitals, local densities of states, and charge densities. For extended systems, where reliable first-principles methods to account for electronically excited states have so far been scarce, our method is very promising. Calculated results, such as the chemiluminescence of halogen molecules impinging on a alkali-metal surface, and the vertical (5 sigma-->2 pi(*)) excitation within the adsorbed CO molecule on the Pd(111) surface, are in working agreement with those of other studies and experiments.