The present paper proposes a general approach for finding differential equations to evaluate probabilities of ruin in finite and infinite time. Attention is given to real-valued non-diffusion processes where a Markov structure is obtainable. Ruin is allowed to occur upon a jump or between the jumps. The key point is to define a process of conditional ruin probabilities and identify this process stopped at the time of ruin as a martingale. Using the theory of marked point processes together with the change-of-variable formula or the martingale representation theorem for point processes, we obtain differential equations for evaluating the probability of ruin.
Numerical illustrations are given by solving a partial differential equation numerically to obtain the probability of ruin over a finite time horizon.