Optical refraction is related to the change in direction of a light ray when the refractive index changes. Excluding Earth's atmospheres and instruments, I think that refraction has little/no impact in astronomy.
The only cases that comes to my mind where we can (probably) have some important refraction is in eclipsing star binaries or near edge on planetary systems.
Let's imagine a planet transiting behind his star. Some of it's light passes through the stellar atmosphere and gets refracted. As the atmosphere is curved and likely changes the refractive index with height, it acts like a lens dispersing (intuition says so) the planet light.
Edit A similar description holds in general for any object passing behind an other one that have atmosphere.
And there is Gravitational Lensing (if you allow me), which has much larger impact on observations. This is caused by gravity bending light rays when passing near galaxies/cluster of galaxies(/stars/...). One of the differences of gravitational lensing with respect to standard lenses is that there is no change in refractive index, so it's achromatic (all wavelengths get bent by the same angle).
The effective index of refraction can be described as ( source: Narayan and Bartelmann(pdf) ):
$$ n = 1 + \frac{2}{c^{2}} |\Phi|$$
where $\Phi$ is the gravitational potential and is generally a function of position of the object.
Gravitational lensing is canonically divided in three groups:
Strong lensing, usually observed in galaxy clusters or around massive galaxies. The gravitational potential is so strong that the the image of a background galaxy is heavily distorted into arcs and rings, like in this striking image of Abell 2218 from HST:

(source: hubblesite.org)
Weak lensing. The light of a galaxy encounters matter (and a lot of dark matter) travelling to us and gets refracted. This doesn't have a dramatic effect as in strong lensing, but distorts the shape of the galaxy. And this distortion can be used to study, e.g., the dark matter distribution around some object or the content of the universe.
Micro lensing. Imagine to observe a star and somehow know that a blob of dark matter is going to pass in front of the star. The blob is not big enough to distort the star shape, but for sure it will increase by a small amount the luminosity of the star.