Create and Set Mesh using script

Hello Everybody,

Can anybody tell me how can I Create and Set Mesh on Sphere dynamically using script
(C# or Javascript)

Thanks in Advance

Don’t know it will work on all meshes but I currently have:

 var myTextMesh;
function Start() {
	myTextMesh = (GetComponent(TextMesh) as TextMesh);
	text = "Testing if it works";
      myTextMesh.text = text;