Dry sex?

When my old boyfriend and I used to have sex things would start off great, but then after a little while I would just dry out and then it would just kinda hurt since it was just like friction. Any advise?