Some common fixed point theorems for compatible mappings of type $(P)$ in metric spaces and probabilistic metric spaces are given. Also, we extend Caristi's fixed point theorem and Ekeland's variational principle in metric spaces to probabilistic metric spaces.