Absorption spectrum theory says that electrons in the atoms absorb only photons of certain frequencies, which causes the dark lines in an absorption spectra. However, I understand that electrons that absorb photons of any energy greater than the work function will be free from the nuclei potential field.
Work function is typically mentioned in photoelectric effect, but any electron is able to absorb any amount of photon energy(so long that the photon energy is greater than the work function). By this logic, there shouldn't be any dark lines since most photons of frequencies larger than the work function will be absorbed.
What is wrong with this thought?