http://upload.wikimedia.org/wikipedia/en/thumb/0/0... 
This example illustrates how a botnet is created and used to send email spam.
1. A botnet operator sends out viruses or worms, infecting ordinary users' computers, whose payload is a malicious application -- the bot.
2. The bot on the infected PC logs into a particular C&C server (often an IRC server, but, in some cases a web server).
3. A spammer purchases access to the botnet from the operator.
4. The spammer sends instructions via the IRC server to the infected PCs, ...
5. ...causing them to send out spam messages to mail servers.