Raycast project to texture at runtime

How do you use raycast or projection to modify a texture at runtime?

What do you mean exactly by modify? drawing on it? Turning it? Deforming the existing texture?