Pain during sex

I have a burning sensation/ friction pain during the beginning of sex and after a few minutes it disappears. We've tried lube and nothing seems to work I just want to know what is causing the pain