A highly luminous sphere object of planet size can be put in the same line as the sun. The sphere does get refracted.
If there is an atmosphere, Sunglow will get refracted if it is turned on but the sun itself is not.
I used a large sphere instead of a planet because you can check invisible on a sphere, but leave it visible to other rays. It still shows up refracted but is not visible in the sky.
In this example the glass sphere is not double sided, so it is refracting in the way of a solid crystal ball, not a soap bubble.