Install Perian. It's a codec pack that helps quicktime recognise nearly all the different types of media files available.
Failing that, install VLC player, which really can recognise just about any file type you can throw at it.
I've got a new iMac. DivX appears to be pre-installed. I also installed Perian. I'm still not getting a picture on .avi's.Some web servers are configured to serve .mp4 with the text/plain content type. Safari respects this type and duly adds the .txt extension. Some other browsers will leave the extension as-is.
As for your .avi issue, have you installed DivX etc?
I've got a new iMac. DivX appears to be pre-installed.