Using Mesh as a Mask

Is there a way to use a mesh as a mask-- perhaps to change the material of one mesh only where it intersects with another mesh?