Electronic Spectra of Trigonal and Disordered Phases of Tellurium and Selenium. I. Theory