What causes pain behind the neck?

Details. Your question lacks detail.Can you please ask again including when you feel pain, is it constant or coming and going,is it daily, all of the time? sporadic?Do you wake up with it or do you only feel it later in the day?I.
Muscles. The neck is held up by spinal bones, ligaments , tendons and muscles. Likely you have a tension type muscular skeletal dysfunction.
This is treated by OTC meds like Advil, Tylenol. Also good for headache.
Massage, chiropractic manipulation can also relax the muscles and realign the natural curve in your neck.
See a doctor if not better in 24 hours for examination.