X-rays show some cavity formation. This could cause some bacterias seeping from the cavity to the pulp through the dentinal tubules. Pulp gets inflamed, becomes more sensitive to external stimuli.
Next Steps
Get caries removed, based on the depth of cavity, the dentist might recommend a filling, a layer of pulp protective material or a root canal treatment.
Health Tips
Do not delay the visit to the dentist as the cavity is only going to deepen even if the pain subsides temporarily.