Follow this tutorial:
http://pdp11.byethost12.com/AVR/ArduinoAsProgrammer.htm
Replace the atmega328p with your atmega8 and do not add any crystal and capacitors.
By doing so you can burn any code you like in your atmega8, including a bootloader if you really want to write one. In most cases, for stand alone applications, the bootloader is not necessary.