Google Talk is about to release a new feature that allows offline messages to be sent. Right now, when send a message to someone not signed in, an error is displayed stating: "<email address> is offline and can't receive messages right now."
When this feature actually rolls out, you will not see that message anymore -- the recipient will see missed messages when they log back in. The FAQ also explains this feature will not work if you are in "off the record" mode or the recipient hasn't enabled chat history.
Note that offline messages can only be sent to users with Gmail addresses, and who have not disabled chat history in their account. If you were chatting off the record before your friend went offline, you'll need to select Stop chatting off the record before sending offline messages.
This feature available yet, but you can see the announcement on Google Talk's "What's New" page.