Hi,... Since the pain is recent in onset, I would suggest you to see a doctor for evaluation.. It may be due to a vascular defect...
Most common reason for this is a fungal infection of the nail. Meet a dermatologist, as you may then need antifungal medicines