The correct answer is:
never
Explanation:
A ray is named using the endpoint first and then another point on the ray. This means that ray AB has endpoint A and point B on the ray; ray BA has endpoint B and point A on the ray. These are not the same ray, as they do not have the same endpoint.