The central thing to remember here is that AVI files are merely a standard wrapper around hundreds of different formats of audio and video data. To play an AVI file you need both the AVI player (for example, Microsoft's Media Player as shipped with Windows 95 and 98) and the relevant codec files to decompress the formats of audio and video in the file.
If your friend can play a given AVI and you cannot, it means that you are missing one of the required codecs on your PC while your friend has it installed on his/her machine. When you try to play the file, you will generally be told which codec is missing ("Can't decompress VIDC.<something>" or an error along these lines). Knowing the <something>, look the codec up on the Compressed Formats page, download it (if possible), install it and try again.
If you can't find the codec you are looking for on this site, you may try a net search using the codec FOURCC as keyword. If this still fails to turn up a suitable download site, try looking here for info on how to copy codecs between PCs.