Do you mean when they go off script? That is definitely an experience thing, expecially if you are running a pre-written adventure or campaign since they don't usually give you good advice on what to do when the PCs zig instead of zag. If you are running home brew adventures, try and prepare plots less and situations more. Present a circumstance and have a strong understanding of who the important NPCs are in the situation and what their motivations are. With that knowledge, improv is much easier.