To add to the answer by Animesh Saxena, I think it's worth mentioning that I think this question is formulated in reverse.
The classic way to price an option is solving either analitically or numerically the associated PDE subject to the terminal and boundary conditions. An alternative approach is to use monte carlo simulation.
It seems far more natural to answer "how much is this contract option worth" as "the amount I expect it to return", and this measured in today's money. So very naturally and immediately we obtain
$$
\text{Value} = \text{Discount} \times \text{Expected payout},
$$
which translates to
$$
V(t,S_t) = \mathbb{E}\left(\exp\left(-\int_t^T r_s \mathrm{d}s\right) P(S_T) \,\middle|\, \mathcal{F}_t\right).
$$
In fact converting the answer of this to a PDE requires a few extra assumptions, such as frictionless trading, continuous availability to hedge, etc. Really the expectation form for the value is the natural representation, and is readily and easily justified theoretically. Of course Monte Carlo is at hand to then estimate this.
The PDE formulation is a by-product of trying to reduce the variability in the value of a portfolio which contains such an option. If continuous trading is allowed, then the risk can be managed by $\Delta$-hedging to zero. If continuous trading is not the case then really you produce a hedging strategy based on the HJB equations and it is a control theory problem. It just so happens that finding this stategy involves solving a PDE for the value of the option.
While Feynman-Kac allows you to usually interchange between PDE and expectational forms for the value, the should always be representable as an expectation as stated above. I don't think we can always write the value in terms of a PDE solution. I think this becomes even more applicable when you move to more interesting SDEs, especially if you start messing with the interest rate and giving that stochastic processes.