(A) Illustration of the rat exposure assay (top) and example track (bottom), with labels depicting the area to which the rat is confined (rat zone) as well as areas near to and far from the rat (safe side). In all figures depicting this assay the rat area will be shown to the right. (B) Example imaging field of view with dorsal periaqueductal gray (dPAG) cells co-registered between elevated plus maze (EPM) and rat exposure sessions. (C) Heatmap depicts the mean z-scored dF/F at each position of the rat exposure assay (left, n = 713 cells). Mean dF/F is significantly greater in the threatening zone than in the safe zone (n = 713 cells, n = 7 mice, U = 2.24, p=0.03, Wilcoxon rank sum test). (D) Change in dF/F (0–2.5 s after minus 0–2.5 s before) activity for all dPAG cells for behaviors in the rat exposure assay (data are represented as mean ± SEM; n of cells for approach, rat movement, escape = 714, n of cells for freeze = 640; approach t = −2.65, **p=0.008, rat movement t = 7.87, ***p<0.001, escape t = 3.28, **p=0.001, freeze t = 0.39, p=0.69, one-sample t-test). (E) Traces show the mean z-scored activity of all cells (±1 SEM), aligned to onset of various behaviors (onset is indicated by the red vertical line) in the rat exposure assay (n of cells same as D). (F) Bars depict the mean z-scored dF/F of cells on the safe side and threatening side of the enclosure (data are represented as mean ± SEM; n = 64 open cells, n = 166 neither cells, n = 87 closed cells; n = 7 mice, safe U = −3.82, ***p=0.0001, threatening U = 3.05, **p=0.002, Wilcoxon rank sum test). (G) Traces show the mean z-scored activity of open, closed, and neither cells (±1 SEM), aligned to exit of the safe side of the enclosure (far from the rat). (H) Bars show the mean change in z-scored dF/F (0–2.5 s after minus 0–2.5 s before) aligned to safe side exit for open, closed, and neither cells (data are represented as mean ± SEM; n = 64 open cells, n = 166 neither cells, n = 87 closed cells; U = 3.29, ***p=0.001, Wilcoxon rank sum test). (I) Traces show the mean z-scored activity of open, closed, and neither cells (±1 SEM), aligned to behaviors in the rat exposure assay (approach, rat movement, escape: n = 64 open cells, n = 87 closed cells, n = 166 neither cells; freeze: n = 50 open cells, n = 67 closed cells, n = 132 neither cells). Onset of behaviors is indicated by a red vertical line. (J) Bars depict the change in z-scored dF/F (0–2.5 s after minus 0–2.5 s before) for behaviors in the rat exposure assay, separately for open, closed, and neither cells (data are represented as mean ± SEM; n of cells same as (I); approach U = 2.45, *p=0.014, rat movement U = −3.70, ***p=0.0002, escape U = −2.12, *p=0.034, freeze U = −3.62, ***p=0.0003, Wilcoxon rank sum test). (K) A generalized linear model (GLM) to predict single-cell activity was constructed using approach, escape, and freeze behaviors as variables. Bar plots show average GLM weights for approach and freeze for open, closed, and neither cells (data are represented as mean ± SEM; n = 62 open cells, n = 155 neither cells, n = 83 closed cells; approach U = 4.17, ***p<0.001, p=0.11, freeze U = 3.02, ***p<0.0002, Wilcoxon rank sum test).