Does what you're rendering actually have anything to do with molecular structure (i.e. what is the motivation for using PyMol)?
If you are drawing some molecular structure, I would recommend just outputting a custom PDB file with the sphere coordinates (you can use the B-factor field per ATOM line as a way of controlling per-atom coloring in PyMol).
If you are not drawing a molecular structure, you would be best off using the CGO interface of PyMol.
From the PyMol documentation:
CGO spheres are generated by the
SPHERE command.
SPHERE, x,y,z,d
where x,y,z are the coordinates of the
sphere centre and d is the diameter of
the sphere. Note how a COLOR command
is used to set the colour of a sphere.
As with LINES you only need a COLOR
command when the colour of the next
sphere to be drawn changes.
A simple example:
from pymol.cgo import *
from pymol import cmd
spherelist = [
COLOR, 0.100, 1.000, 0.000,
SPHERE, 30.304, 30.407, 30.531,0.30,
COLOR, 1.000, 0.000, 0.000,
SPHERE, 30.250, 30.250, 30.250,0.20,
]
cmd.load_cgo(spherelist, 'segment', 1)