How to send a facebook chat message when your computer is switched off?

Sometimes I sign into facebook and I see that someone has written me a message on fb chat while I've been offline. I can't reply, because by then they are offline. How come they can send me a fb chat message when I'm not on facebook and my computer is switched off?

Because the message sits on Face Book's servers till such time you next log on.

No different to your emails. Someone sends you one and it sits on the servers until
such time you retrieve them.