Final answer:
Sebaceous glands secrete sebum, an oily substance that lubricates and protects the skin and hair, and has antibacterial properties.
Step-by-step explanation:
The gland that produces an oily substance which lubricates the hair and skin is the sebaceous gland. These glands are found throughout the body, often associated with hair follicles. They secrete sebum, a mixture of lipids that not only lubricates and waterproofs the skin and hair, but also has antibacterial properties. Sebaceous glands play a crucial role in maintaining the health of the skin and are especially active after puberty due to hormonal stimulation.