Hello and hope you are doing well.
The condition needs proper evaluation. It could be due to an injury, It could be due to a middle ear infection, which can spread causing a painful lump behind the ear. This could be a lymph node or sometimes the infection can spread to the mastoid bone. Sometimes repetitive injuries or strain can also produce these symptoms. Inflammation of the muscles, joints and surrounding soft tissues can also cause pain. Discuss these options with your consulting doctor.
In the meantime you can take OTC pain medication Ibuprofen. Ensure to take this medication after food to avoid gastritis.
Hope this helped and do keep us posted.