As any writer will tell you, it can be very frustrating. It usually happens because I haven't done enough homework on my character(s) or the plot, and I need to go back and do some further development of one or both. Do they seem like real people? What are they motivated by? What are the internal battles they face? What is pushing against them externally? How are the characters handling these conflicts in their relationships with each other? Once I revisit this, I can usually get back on track.