Sound waves, also known as acoustic waves is essentially created by mechanical vibration and propagation of the vibration through any medium. It is almost similar to you threw a stone in a pool and water waves are created. read more
So, when a sound is produced some of the energy is transferred to the medium, this energy/vibrations travels into the medium and reaches our ear. The remaining sound energy(quite small) dispersed in the form of heat. In other words you can say as there is no medium around the sun, sound energy is not generated at all. read more
But it seems that in some circumstances, sound can jump between objects in a vacuum after all. Sound waves are travelling vibrations of particles in media such as air, water or metal. So it stands to reason that they cannot travel through empty space, where there are no atoms or molecules to vibrate. read more
When we clap our hands, the vibrations compress surrounding air molecules to produce a sound wave that we can hear. If an astronaut in space were to clap his hands, sound waves would occur between the clapped hands, but with no air molecules around, it would not produce a sound that the astronaut (or anyone) can hear. read more