Spyware is a class of malware that, as its name implies, is typically designed to spy on you or your computer, silently collecting information that is subsequently sent on to others for typically nefarious purposes.
Various forms of advertising, including additional toolbars, homepage hacks, and data insertion (while technically not a form of spying) are often also included in the term spyware.
While very similar to viruses, spyware detection differs from virus detection in that it’s more behavioral; it watches what your computer is doing to determine the presence of spyware. Virus detection is more typically data-based, looking for specific patters of data that indicate the presence of a virus.
In reality, the lines between spyware and other forms of malware tend to blur, although typically a protection solution for each is still required.