Arduino to upload a hex file to another device?

you will need to upload the arduinoisp sketch onto a arduino (dont know if the mega 8 will work for this) then you can use avr dude as if it was connected to an avrisp programmer

http://www.ladyada.net/learn/avr/avrdude.html