Sure! Here's a tutorial using a square: https://paroj.github.io/gltut/Illumination/Tutorial%2013.htm...
In my implementation, I render a cube and discard any pixels that aren't along a ray intersecting the sphere, while the rest are colored according to user settings and atom colors. The same approach is taken with the cylindrical bonds, except of course it's a ray-cylinder intersection instead.