How do we learn so much about interstellar objects millions of light years from Earth?

It is inconceivable that we could send a probe to galaxies, stars or even gas clouds millions of light years from Earth and yet we know so much about them.
We use instruments such as telescopes and spectroscopes to analyse light coming from or passing through objects in the universe. This is called spectrosopy. When you look at a star you see the unbroken light travelling from it revealing its exernal features. Breaking up a star's light to display its spectrum reveals its anatomy and processes. When you look at the light from the Sun, through a prism, you see the amazing range of colors of the rainbow. This is called the visible spectrum where each colour corresponds to a certain energy. The blue end of the spectrum has a higher energy than the red end.

The Sun gives off a variety of different energies spanning from radio waves to gamma rays, as shown below. This range of energies is known as the electromagnetic spectrum and the visible spectrum, that we see, only represents a small portion of the electromagnetic spectrum. Energy from the Sun comes to us in waves and travels at 300,000 km/s, known as the speed of light.. The smaller the waves the higher the energy so we can see that radio waves have less energy than gamma rays.

A great deal of information can be gathered about our sun or distant stars by analysing the light coming from them. Analysing even the visible spectrum reveals information about distant galaxies and stars that would otherwise be impossible to gather. The visible spectrum is but a small fraction of the array of energy given out by a star. Below is a picture depicting the narrow band of energy that we call the visible spectrum.


Flame tests

What is emission spectroscopy.
X-ray and gamma ray telescopes