This happens for many reasons. In many cases though, it is due to overly aggressive tooth brushing.
It is critical to get the right information, and the instruction to deal with this. Otherwise, you get the problem recurring over and over again, and the pain never goes away.
It is essential to have a proper, thorough examination to identify exactly what is causing this problem. Quite often, it can be a sign of something much more involved, than just the exposed root surface. You would want that investigated and attended to much earlier, rather than later.