Welcome to HealthcareMagic forum.
Pain behind the ear could be due to an arterial spasm , an inflammed artery
, sometimes vertigo
,any underlying infection can cause the same,sometimes thrombosis
. Taking painkillers alone may not help, you need to visit an ENT specialist and get the cause treated , you may need an antibiotic or antiinflammatory drugs or others depending on what the cause is.
Wish you a speedy recovery