example for geometry:

material nameOfTheWadTexture{
yourDefs;
}

starter shader_load{
d3d_automaterial=1;//lvl geo
effect_load(nameOfTheWadTexture,"yourFxFileWithTheShader.fx"); //apply fx file
nameOfTheWadTexture.effect=nameOfTheWadTexture2.effect=nameOfTheWadTexture3.effect [andSoForth];//same effect for all mats you define
wait(5);
}

PS: there is an entity.material pointer as well, so if you just want to apply one <c-script>-material to some ents (and not an fx-based material as posted above), you could just use ent1.material=ent2.material with the appropriate pointers.