Maran Ha’Shulchan Aruch (Chapter 314, Section 11) writes that one may not use wax to seal a hole of a barrel on Shabbat, as this constitutes the forbidden work of “smoothing” on Shabbat.
This forbidden work refers to smoothing or smearing things on Shabbat. Thus, even when one wishes to rub cream on one’s hands on Shabbat to prevent the skin from drying, this is likewise forbidden on Shabbat.
Similarly, applying sunscreen on Shabbat to avoid getting a sunburn likewise falls under the category of the prohibition of smoothing on Shabbat.
Maran Ha’Shulchan Aruch (Chapter 316) adds that one who spits on the ground may not step on it and smear the saliva until it is absorbed in the ground. However, this prohibition is not due to smoothing; rather, it is as a result of the prohibition of leveling the ground which is a subcategory of the forbidden work of plowing.
The Magen Avraham explains that the reason why the aforementioned case does not constitute the prohibition of smoothing is because this prohibition applies only when one smears one thing onto another and one wishes for the substance being smeared to remain, such as with regards to the wax being used to seal the hole of the barrel. However, when one wishes for the smeared substance to be completely absorbed and disappear, this does not constitute the prohibition of smoothing. Thus, if one spits on a finished floor (as opposed to dirt) and then wipes the saliva with one’s shoe so that it disappears and others do not see it, no prohibition of smoothing exists here.
Based on this, Maran Rabbeinu Ovadia Yosef zt”l writes (in his Responsa Yabia Omer, Volume 4, Chapter 27 and Chazon Ovadia- Shabbat, Volume page 384) that if one applies cream and wants it to be completely absorbed into the skin (as is the case with people who suffer from dry skin and wounds and want to rub cream on their hands but have no interest for any of the cream to remain on the skin’s surface), this would be permissible on Shabbat. Similarly, if one wishes to apply cream to one’s back to relieve one’s back pain and the cream is one that is completely absorbed into the skin, it is likewise permissible to rub the cream onto the skin of one’s back.
Likewise, one may apply cream or ointment to the skin of a baby that suffers from diaper rash when the cream or ointment is completely rubbed into the skin and this does not constitute the prohibition of smoothing.
Nevertheless, regarding a healthy adult, this leniency only applies to one who has begun using such cream before Shabbat, for if not, there is a separate issue of healing on Shabbat which may apply.
Regarding a baby who suffers from diaper rash and one wishes for a layer of the cream not to be absorbed by the skin so that is can coat the skin and create a protective barrier, several Acharonim write that one may dab on “dots” of cream on the baby’s skin which will then be smeared by the diaper. However, the cream should not be manually rubbed on in such a way (that it will not be fully absorbed) as one would on a regular weekday.