If $h$ solves the equation $Ph=e^{-g}h$, then $$ M_n\colon=h(X_n)\exp\Big(\sum_{j=0}^{n-1}g(X_j)\Big) $$ is a martingale with respect to all $\P^x$. Of course, we need some integrability condition; if you like assume that both $h$ and $g$ are bounded! If moreover $h|A=1$, then $$ h(x)=\E^x\exp\Big(\sum_{j=0}^{H_A-1}g(X_j)\Big)~. $$
\begin{eqnarray*} \E^x(M_{n+1}|\F_n) &=&\E^x\Big(h(X_{n+1})\exp\Big(\sum_{j=0}^{n}g(X_j)\Big)|\F_n\Big)\\ &=&\E^{X_n}h(X_1)\exp\Big(\sum_{j=0}^{n}g(X_j)\Big)\\ &=&Ph(X_n)e^{g(X_n)}\exp\Big(\sum_{j=0}^{n-1}g(X_j)\Big) =h(X_n)\exp\Big(\sum_{j=0}^{n-1}g(X_j)\Big) =M_n \end{eqnarray*} By the Optional Stopping Theorem we conclude that $\E^xM_0=\E^xM_{H_A}$ and since $h|A=1$: $$ h(x)=\E^x\exp\Big(\sum_{j=0}^{H_A-1}g(X_j)\Big)~. $$