Where to start to achieve this effect?

there is no easy way for materials to know where light is hitting them. but there may very well be easy solutions to your problem once you tell us a bit more about your specific use-case. for example if your spotlight is in first person, etc.