As mankind turns their eyes back to space and technology edges us ever closer to a life outside of the atmosphere, there must also be contingency plans established in case the worst happens to astronauts. To date, there is no defined protocol for returning remains back to Earth. This will need to change as more and more astronauts take to the skies.
There have been eighteen deaths during spaceflight. The three deaths to occur in space (above 100 km elevation) were also the only remains properly recovered. The crew of the Soyuz 11 perished on June 29th, 1971 while they were preparing for re-entry. Their names are Georgy Dobrovolsky, Vladislav Volkov, and Viktor Patsayev. Their remains were recovered at the intended landing site — an autopsy ruled the cause of death a capsule-decompression failure — and the astronauts were properly laid to rest. They may be the first and only astronauts to be given this respect.
If an astronaut were to die on a spacewalk and his or her body went unrecovered, they would float lifelessly until caught in the atmosphere, at which point they'd burn in the reentry process. Until then, no bacteria could survive to decompose the body, so it would remain frozen as the days passed.
However, due to the UN's strict "no littering" policy in space, the family and nation of the astronaut would be required to recover the remains and lay them rest with dignity. A space free-float wouldn't happen.
This also rules out all possible funerals, like the one given to Spock. (Paramount Pictures' Star Trek II: The Wrath of Khan)
According to Col. Chris Hadfield in his book, An Astronaut's Guide to Earth, today's astronauts conduct simulations for onboard deaths, but taking care of the body is tricky and very unpleasant. The remains are placed inside of a GoreTex bodybag. Then, it is isolated immediately in the airlock to avoid contamination to the air supply.
The funeral rites are then given to the deceased. This would include speeches by world leaders, the deceased's family, and the crew. The body is then exposed to space to freeze. A robotic arm then takes the corpse and vibrates it outside of the spacecraft until the body breaks down into a powder, which is then released into space. As morbid as it is, it saves valuable room in the spacecraft and keeps the other astronauts safe. In a way, the astronaut becomes a part of space.
The powder that remains in the bag is then given to the family on the next return voyage, allowing them to pay the proper respects.