First of all, it should be clear that the spirit of Hajj is turning to Allah wholeheartedly in humble and passionate yearning and ardent love and devotion. This spirit should rule the hearts of all pilgrims at all times. Pilgrims must refrain from all forms of intimate contact with spouses and shun all vain talk, wrangling and quarrels.
Likewise, pilgrims must absolutely avoid using any kind of perfumes or scents, clipping nails, and removing, plucking, trimming or shaving hair. It is, however, permissible for pilgrims to bathe, shower, or wash. Also, they are permitted to use ordinary shampoos, soaps, creams, and lotions, etc., so long as these are not scented.
Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states: “it is allowed to use sunblock for purposes of protecting our skins against the heat of the sun, which may cause some problems, so long as it does not contain perfume. This falls under the category of exceptional rulings. The Prophet (peace and blessings be upon him) allowed certain exceptional rulings for pilgrims suffering from lice, and he is also reported to have given permission to `Abdur-Rahman Ibn `Awf and Az-Zubayr Ibn Al-`Awwam, two prominent Companions, to wear silk, although it was not during Hajj. Silk was otherwise forbidden [for men].
Since there is no such strict prohibition applying to sunblock, then it can be permissible in case of necessity.”
Regarding the same issue of protecting oneself from the sun, Al-Azhar House of Fatwa says:
“There is nothing wrong in using an umbrella or the like to protect oneself from the heat of the sun, as there is no evidence to forbid this act. On the contrary, the permissibility of doing so is confirmed by the following Hadith: Umm Al-Husayn, may Allah be pleased with her, narrated: “I performed Hajj with Allah’s Messenger (peace and blessings be upon him) on the occasion of Hajjatul Wada` (the Farewell Pilgrimage). I saw him when he flung pebbles at Jamrat Al-`Aqabah and returned while he was riding his camel, and Bilal and Usamah were with him. One of them was leading his camel, while the other was raising his cloth over the head of Allah’s Messenger (peace and blessings be upon him) to protect him from the sun.” (Reported by Muslim, Abu Dawud and An-Nasa’i)”