I have a lot of experience of working with painful intercourse presented by individual men and women as well as in couples. The most obvious factor that causes pain is size of genitalia; to lessen pain might mean avoiding thrusting too deeply thereby hurting the cervix or changing position. Women and men can experience pain if she is not sufficiently lubricated during sex and using lubricants such as Yes http://www.yesyesyes.org/ may be helpful as part of foreplay.
In men pain during sex can manifest as Phimosis where the foreskin is tight and cannot retract or be pulled back sufficiently revealing the gland or head of the penis. A significant number of men, generally through little sexual experience, can endure this condition well into their twenties and thirties before it is 'discovered' or comes to light in an intimate relationship. Circumcision is often best practice and whilst this addressees the pain issue, it can take some time for men to improve sexual confidence and performance given that sexual activity historically has been scant. Psychosexual therapy can be useful in this instance.
I come across more pain (dyspareunia) in women in my practice. The most common presentation is what was called Vaginismus but now comes under the term Genito-Pelvic Pain Disorder/Penetration Disorder. I see women as individuals and as part of a couple relationship and predominantly 'Primary' or 'Lifelong' which means that these women have never been able to have intercourse and in many cases not so much as a finger tip has been able to enter the vagina never mind endure a smear test or other gynaecological examination. In cases where penetration disorder is 'secondary' an example might be a trauma suffered that prohibits penetration.
There can also be physical pain as well as an anxious/avoidant psychological response to penetration, sexual intimacy with another and sexual intimacy with self. Taking a good history is a necessary step in identifying how to treat and help cases where responses to cultural influences, early sexual abuse and similar trauma is affecting the adult's approach to sex and relationships.
With the right support and practical guidance, Penetration Disorder is treated extremely successfully. I encourage spouses/partners to get on-board with this support and whilst the focus is on the woman's Penetration Disorder, it is often a couples issue to get through with a guided plan towards consummation if that is the goal.