How do materials absorb light? I've seen a lot of different different answers online so I just want a clarification.
Electrons can absorb photons in 2 ways. The first way involves the electron cloud oscillating with the photon but emit it again without permanently absorbing it. The other way involves the electron cloud oscillating at around its resonant frequency, which causes the absorption of photons to excite the electron cloud to higher energy states. But from my understanding of quantum mechanics, energy levels should be discrete, why would a range of photons be able to cause the elctron clouds to resonate and then excite them to different degrees? Also, is emission lines only produced by ions and would be irrelevant here?
 A: Let us first try to understand why we must get peaks in our spectra. Considered for simplicity, transitions between $3$ energy levels. Now if the energy levels are sharply defined, then we expect to see three peaks in our spectra, not because there are $3$ levels but because there are $3$ unique pairs that can be formed ($^3C_2=3$).The height of the spectra depends on how strongly the energy levels in question couple with the electromagnetic field. 
In gases, the energy levels are usually sharply defined. But still the spectra is not completely discrete. One of the main reasons is Doppler effect. Due to the motion of the atoms, they see a Doppler shifted frequency of the incoming light. This means they absorb light of “wrong” frequency. And since the atoms in general have a velocity distribution, this translates to a distribution in the resonant frequency. This causes a broadening in the spectra(which can be reduced by lowering the temperature). 

Coming to solids, the energy levels are not sharp to begin with. They are broad in general. Thus there is a continuous range of transition that can be made. 

A: The answer of Fellow Traveller is indeed correct and I'll just clarify some extra points. You described different phenomena in your question, and that's okay because some explanations are somewhat misleading or mix them up. To make them clear, let's think from a purely quantum mechanical way, with states describing our entire system (atom/electron + photon). To simplify everything, let's think our atom only have two states, $1$ and $2$, with state $2$ having a higher energy than state $1$ ($E_2 > E_1$).


*

*I'll start with 'true' absorption. In this case we start with an incoming photon of energy $E$ and an atom with an electron in state $1$. After the interaction takes place, the final state of the system is zero photons and the electron occupying state $2$. This only has a high probability of happening if $E \simeq E_2 - E_1$, that is, the photon energy is very close to the energy difference between the levels (how 'close' that must be depends on other factors as outlined by Fellow's answer). Schematically, we had
$$
\text{1 photon} + \text{electron in state 1} \to 0 \text{ photons} + \text{electron in state 2}
$$

*Next is scattering. Scattering is very similar, we start with a photon of energy $E$ and the electron at state $1$. They only differ in the final state: we end up with the electron at the same state and we still have one photon, although now the photon may propagate in a different direction. How much the direction can change depends on how strongly the interaction between the electron and the photon was. It is enhanced whenever $E \simeq E_2 - E_1$, so photons that could be absorbed could very well be scattered too. Schematically,
$$
\text{1 photon} + \text{electron in state 1} \to 1 \text{ photon (different direction)} + \text{electron in state 1}
$$

*The last one is absorption followed by emission. These are actually two different process happening in sequence, but we can differentiate it from scattering. There's usually a 'big' time delay between absorption and emission compared to just scattering, and that can be measured. So schematically, we have to draw two different events, remembering that there is an interval of time between them
$$
\text{1 photon} + \text{electron in state 1} \to 0 \text{ photons} + \text{electron in state 2}
$$
$$
\text{0 photons} + \text{electron in state 2} \to 1 \text{ photon (different direction)} + \text{electron in state 1}
$$
A: I'm not an expert. And you only need to be aware of the reactions your class or test is concerned with. But:


*

*Strictly speaking, electrons aren't the only particles that can interact with light. :) Any charged particle can interact. There are also articles describing photon interactions with uncharged particles, such as neutrons or other photons, but I'm not sure if that is significant, or even possible, in the visible light range. And some nuclear reactions produce photons, though I'm not sure if any are in the visible light range. Perhaps the reverse reactions can absorb light?

*Electron band states, which encompass more than one atom or molecule in a cooperative state, also interact with light. That's fascinating. For example, pure quartz crystal is transparent to visible light, because the absorption and emission lines are outside the visible light range. But if you add certain impurities,  even by, say, a part per billion, that can shift the energy levels, and the corresponding lines, of an entire crystal, or of a significant portion of it, by a lot, creating colored quartz crystal - and the color depends on the amount, not just the type, of impurity. (The effect isn't limited to quartz, by the way.) A photon can interact with such an altered band state even if it comes nowhere near an impurity atom, because an impurity atom alters the way all or many of the other atoms in the crystal interact with their electrons, and, in a sense, some of the electrons can be viewed as shared throughout some or all of the crystal. And the photon can sometimes somehow be absorbed by the entire crystal, rather than one atom or molecule. Similar effects are very important to solid state electronics. E.g., there are devices which absorb or emit photons while shifting an electron from a region with one band state energy level, to a region with another band state energy level.

*In addition to bound states, electrons can transition to and from "free" states, with fairly arbitrary energies of motion. E.g., a photon can free an electron from its atom or molecule or ion (the photoelectric effect).

*This is beyond my full understanding, but photons can be absorbed into and create moleculer vibrations, and crystal vibrations (phonons). I'm not sure if that always has to be initiated by a different type of absorption or scattering, or if it can occur on its own.

*Also - beyond my understanding, I think a photon can be absorbed or created in a chemical reaction, by means other than interaction with just the electrons.

*Again, beyond my understanding, I think some materials can split a photon into a differently polarized pair (or triplit) of photons. I'm not certain I understand that, or have it right. Perhaps they only split beams of photons with mixed polarization into separate beams?

*I'm sure there are many other reactions I haven't thought of, or am unaware of.
BUT - in a low level physics course, you might only study the simple absorption of a single photon by a single atom. The real world is always much more complex than any simple (or, usually, advanced) textbook - but for a given class (or test), you only need the version of the truth that the teacher (or test) expects you to learn. That can vary from text to text, class to class, and teacher to teacher. 
Many teachers are happy to explain what they want you to learn, if you meet them after class or within their official visiting hours.
