Cyst or bone spur
This sounds like it could be from a cyst or a bone spur; if it appeared relatively suddenly, a cyst is more likely.
If its been forming for years, its more likely a bone spur. Both can be painful. If its bothering you, have it evaluated by an orthopedic surgeon.