I've been doing my homework on the byzantine world of codecs for video and I've come to the conclusion that if you want to compress your video for the widest range of software and hardware, you should do it with the H.264 codec.
Here's a table that demonstrates why.
The orange "Yes" boxes means it requires an additional plugin, but can play it.
H.264 is compatible with pretty much every device and program I use (and most people use). For media playback and sharing, I've switched from WMP to Zune (software) since it can play H.264 out of the box.
Even if you're on Windows, this can show you what a losing proposition it is to encode with Divx and Xvid. You might be able to play them back on your Windows machine, but the only stock machine that plays it back without an additional plugin is your Xbox 360! I'm not really sure why you'd encode with either of these anymore except that they're faster than H.264. Maybe someone can enlighten me in the comments.
WMV is a slightly better choice if you plan on always expecting your audience to be using Microsoft devices, and Silverlight to view the content on the web. It's easy to encode with Windows Movie Maker. However, Flash just published their update the other day that provides H.264 video in the flash plugin. I was using Silverlight video for a website, but I think I'm going over to Flash now that H.264 is provided, and all of my devices support it so well.