Dear Student,
Sun's 'heat rays' travel through the vacuum .
1-Heat is a form of energy released from the sun and travels through radiation in vacuum.
Heat can be transferred in three different ways: conduction, convection and radiation.
2- Energy like sound energy which require a medium for propagation can not travel through vaccum.