def parse(raw_message):
    """Breaks a message from an IRC server into components.

    Parameters
    ----------
    raw_message: str
        The raw message received from the IRC server.

    Returns
    -------
    nick: str
        The nick name of the sender.
    host: str
        The host of the IRC message (nick!user@host).
    command: str
        The IRC command.
    target: str
        The target to which the message was sent (usually #channel or nick).
    text: str
        The text sent (the last value in `args`).
    args: list
        The arguments in the IRC message.
    """
    host = ''
    if not raw_message:
        raise Exception('Cannot parse an empty message.')
    if raw_message[0] == ':':
        host, raw_message = raw_message[1:].split(' ', 1)
    if raw_message.find(' :') != -1:
        raw_message, trailing = raw_message.split(' :', 1)
        args = raw_message.split()
        args.append(trailing)
    else:
        args = raw_message.split()
    command = args.pop(0)
    nick = host.split('!', 2)[0] if '!' in host else ''
    target = args[0] if len(args) > 0 else ''
    text = args[-1] if len(args) > 0 else ''
    return nick, host, command, target, text, args
