have a/the right to...

As in the subject, which article is more proper? I came across both variants and I’m not sure if they are equally correct.

You have a right to do sth.

…or…

You have the right to do sth.

Both are correct and context dictates which to use, though very often the context allows for them to be interchanged.
Basically the more specific you are being about the right, the more likely it is that you should use the definite article. I think use of the definite article is far more common.