The structure of the energy spectrum of amorphous semiconductors as determined by the formation of covalent bonds is analyzed. In contrast with other theoretical models all considerations are based on a realistic model of the atomic structure of a-Si and a-Ge. The mathematical method used throughout the paper is, within certain subspaces (cells) of the total Hilbert space, the partial diagonalization of the Hamiltonian represented in an "extended Hilbert space". Existing model Hamiltonians, e.g. the Weaire-Thorpe model, are generalized in such a way that real disordered solids can be described. The molecular model used in this paper yields the basic feature of the structure of the energy spectrum. For positionally disordered systems an Anderson-like Hamiltonian is obtained. The formation of extended and localized states in disordered solids is explained by taking into account the residual interactions. Conditions for the localization of electronic states and the existence of mobility edges depending on the local and global atomic structure of amorphous semiconductors are given. A generalization of the cell model in the spirit of the scaling theory of localization leads to a method for the determination of the position of the mobility edges. Structural correlation in amorphous semiconductors manifesting itself in short-range order and in the existence of voids, which is not taken into account e.g. in the Anderson model, is found to be the origin of the basic structural properties of the energy spectrum of disordered semiconductors. Conclusions from the theory proposed are in accordance with experimental findings and explain them.