Exact solutions for spectra and Green's functions in random one-dimensional systems