Dyspareunia is defined as painful intercourse. It can occur before, during, or after sex. Causes include insufficient lubrication, injury or inflammation, vaginismus, and certain medical conditions. Physical factors like lack of arousal can cause entry pain, while deep pain may be from conditions that involve the pelvis. Emotional and psychological issues as well as past trauma can also contribute. Treatment focuses on the underlying cause, and lifestyle changes like switching positions, communicating, taking time with foreplay, and using lubricants can help reduce pain.