Changing sphere material via script

Hello:

I have a sphere with the Wireframe material and I would like to change it to WindowOcclusion (to make it transparent) via script. What would be the right way of doing it?

I would appreciate any help.
Thanks
Gus