optimizing / compressing video for web with Quicktime
To add on to AJ's answer, Vimeo has a dedicated page on their preferred compression settings; Youtube has the same.

Check these out for some more specific information on which bitrate/codec to choose!