Why am I having pain behind my eye near my brain?

Inflammation. Could be a soreness from the front of the eye projecting back behind the eye (like a heart attack causing left arm pain). Could be sinusitis. Could be true inflammation of the optic nerve. There are other inflammatory diseases of the eye socket. Get seen by an ophthalmologist.