While it's better to shave at least 24 hours before a spray tan for optimal results, technically, you could shave 2 hours prior. However, the key risk you face is that shaving opens up your pores, and the spray tan could settle into these, giving an uneven or spotty appearance.