Consider a knock-and out barrier option written on a stock, let (B>S_0) be the barrier. You could study the discounted price of the stock or its stopped version, i.e. the (e^{-rt}S_{t\wedge T_B}). They are both martingale thanks to the theorem, but the stopped one is much better since you could think of the payoff of the option as something that depends only on the value of the process at time T.
The stock price S does not stop at the barrier, but does the replication portfolio of a barrier option.