Core and valence electronic levels of normal alkanes have been studied in the solid phase by means of x-ray photoelectron spectroscopy. By comparing the calibrated C 1s core-level binding energies with previous measurements in the gas phase, one estimates the magnitude of the polarization or the extra-molecular relaxation energy to be about 1.5 eV. The observed structures in the valence band from n-pentane to polyethylene are discussed in terms of the evolution of an electronic level to a band structure in a quasi-one-dimensional solid. Intermolecular interactions and crystal-field effect on solid-state electron energy distribution are studied by comparing gas- and solid-phase spectra. Long-range interatomic interactions in a tridimensional solid are analyzed through the comparison of the valence-band structures in polyethylene, graphite, and diamond.