It depends from program to program. If you have Photoshop, it's quiet easy. Either use the spherize filter or the 3D rendering form 2D layer option, and then mess around with the settings of the layer, such as inner shadow, gradient, glow, etc. Then you can add some noise filters in the background, to look like stars, and some white brushing to make the atmosphere if you want.
I made the other one using the spherize filter, and this one using the 3D action, which I never used before. I like the spherize filter, as you have more control over it, and it doesn't look as modely as the 3D action.