Why are line spectra only seen in gases? This might be a stupid question but I could not find the answer in my textbook or on the internet with a few searches. 
So I believe when an atomic electron moves down to a lower energy level it emits radiation in the process. However since the energy levels are discrete, the photons released have specific energies and hence wavelength which results in the line spectra.
However apparently this is only true for hot gases and not liquids or solids, which have continous emission spectrum. Why is this?
 A: It's a good question, it's not stupid. Actually, this phenomena can be observed with liquids and solids as well. Each element has its own distinct spectral line and this fact can and has been used to identify an element. However, it is much more difficult to observe the spectral lines of liquids and solids due to how close together the atoms are. Also, tables of the spectral lines of elements only seem to go up to the 99th element, Einsteinium (not including Astatine (At, 85) and Francium (Fr, 87). 
I could not find any data as to why this may be, however, I believe it is simply because we could not test for the spectral lines of the heavier elements due to their instability and scarcity. It's incredible because some of the heavier and more unstable elements have insanely short half lives ranging from 100.5 days (the most stable isotope of fermium (Fm, 100)), to 0.69 microseconds (0.00069 milliseconds) (Oganesson (Og, 118)). This would make measuring their spectral lines nearly impossible. This isn't even considering how much this would cost. These heavier elements likely have their own spectral lines, however, due to all I stated above, it isn't exactly possible to measure.
I hope this helped,
You can see a list of of all the known spectral lines of elements on Wikipedia since it seems to have the most updated table. mostly all textbooks on the spectral lines of elements tend to only go up to uranium, however, textbooks go into much more detail for each element.
https://en.wikipedia.org/wiki/Spectral_line
A: In liquids and solids the difference in energy between energy levels becomes very small, due to the electron clouds of several atoms bein in very close proximity of one another. These similar energy levels will form 'bands' of indistinguishable spectral lines. 
In gases however, atoms will be spaced loosely enough such that the interaction between atoms will be minimal. This allows the energy levels to have sufficient difference in energy for distinct lines to be formed.
A: 
However apparently this is only true for hot gases and not liquids or
  solids

Rather than the phase of the material, you should be evaluating the optical thickness.  
If the material is roughly transparent (like a thin gas), then the discrete transition radiation can be directly received and you see the line spectrum.
If the material is roughly opaque, then the discrete transition radiation is more likely to interact with the material.  This interaction thermalizes the radiation and generates the continuous spectrum.  
http://www.physics.usyd.edu.au/~helenj/SeniorAstro/lecture04.pdf
Note that the important point here is that the radiation is interacting with the material, not whether the material has any interaction with itself.
The base of photosphere (where the continuous spectrum of the sun comes from), is not particularly dense at around $3\times 10^{-4}\text{kg/m}^3$.  But the total amount of material is sufficient to block radiation produced deeper.
A: You see line spectra usually only in gases because there the interaction between the atoms can be neglected. In gases with high pressures you get the so-called collision broadening of the lines which eventually become bands. Similarly, in liquids and solid the atoms are so close that the interaction between them leads to the discrete spectral lines becoming bands. 
