12. Given the ellipse $\frac{x^{2}}{4}+y^{2}=1$ and the hyperbola $x^{2}-\frac{y^{2}}{2}=1$, where $F_{1} 、 F_{2}$ are the foci of the ellipse, and $P$ is an intersection point of the ellipse and the hyperbola. Then $\cos \angle F_{1} P F_{2}$ $=$ . $\qquad$
12. $-\frac{1}{3}$.

From the problem, we know that $F_{1}$ and $F_{2}$ are the common foci of the ellipse and the hyperbola, and $\left|F_{1} F_{2}\right|=2 \sqrt{3}$. According to the definitions of the ellipse and the hyperbola,
$$
\left|P F_{1}\right|+\left|P F_{2}\right|=4, \quad || P F_{1}|-| P F_{2}||=2 \text {, }
$$

which means
$$
\begin{array}{l}
\left|P F_{1}\right|^{2}+2\left|P F_{1}\right| \cdot\left|P F_{2}\right|+\left|P F_{2}\right|^{2}=16, \\
\left|P F_{1}\right|^{2}-2\left|P F_{1}\right| \cdot\left|P F_{2}\right|+\left|P F_{2}\right|^{2}=4 .
\end{array}
$$

From equations (1) and (2), we have
$$
\begin{array}{l}
\left|P F_{1}\right|^{2}+\left|P F_{2}\right|^{2}=10, \quad \left|P F_{1}\right| \cdot\left|P F_{2}\right|=3 . \\
\text { Therefore, } \cos \angle F_{1} P F_{2}=\frac{\left|P F_{1}\right|^{2}+\left|P F_{2}\right|^{2}-\left|F_{1} F_{2}\right|^{2}}{2\left|P F_{1}\right| \cdot\left|P F_{2}\right|}=-\frac{1}{3} .
\end{array}
$$