If there is pain then mostly the caries have infected your pulp resulting in pain .you can save the tooth by getting a Root canal treatment followed by crown ( cap).
Exact treatment plan can be given only after having a look at your x-ray and by knowing which tooth it is .
Kindly send your x-ray as its not attached here.
Next Steps
visit your nearest to get the treatment done
Health Tips
you can take a pain killer for temporary relief .