That is:
- virus infects files (and spreads this way)
- worm just spreads its own files, usually by sending itself by e-mail
- trojan horse doesn't spread - it just sits on one place, doing bad things
But in real life, it's often hard to distinguish the parituclar "viruses" exactly - they often possess all three "behaviors".