Spam refers to unsolicited email - speculative email that you didn't ask for. It comes from a number of sources, including personal computers that have been hijacked by the unwitting installation of malware.
Malware is the generic term for small programs intended to disrupt, damage or steal. This includes viruses, trojans, worms, spyware, intrusive adware, rootkits and other, more exotic nasties. The results can range from minor annoyance, through data loss, to identity and financial theft.
Keyloggers are designed to capture keystrokes, ie everything you type in, and then transmit them to a third party. They will reveal bank passwords, for example. Keyloggers are widely available, but generally well detected by anti-spyware software.
The main concern used to be viruses and trojans in email attachments. The bigger worry now is being lured to specially crafted websites, which then install malware. This can be automatic or more commonly by prompting the user to download a new anti-virus application, anti-spyware suite or codec for example. All sound attractive, even essential, but all can be harmful and extremely difficult to remove.

