Bacteria, viruses are not cells; they consist of DNA or RNA molecules, containing the virus' genes, surrounded by a protein coat. A virus can attach itself to cells and inject molecules into the cell, or the cell may absorb it. Once inside, the molecules cause the infected cell to make new viruses that can spread to other cells.
Spectroscopy is a technique often used by astronomers and physicists to study the make-up of an object based on the light it emits. In this case, it is used to identify the scattering of light off of the DNA and RNA within viruses. This is possible because each chemical element has a unique signature, emitting or absorbing radiation at specific wavelengths. For example, sodium, used in street lights, emits primarily orange light. Oxygen, used in neon lights, emits green light. By passing the light from a star or other object through a special instrument, called a spectrograph, the light is "spread" into a spectrum in much the same way visible light is spread into its colors by a prism. By carefully studying how the spectrum becomes brighter or darker at each wavelength, scientists can tell what chemical elements are present.