Background: Pain is an unpleasant sensory and emotional experience followed by anxiety, depression, and frustration. Functional Near-Infrared Spectroscopy (fNIRS) as an optical technique identifies the brain functional networks by investigating connectivity between functionally linked of different anatomical regions in response to pain stimulation. Methods: In this research, fNIRS was performed in order to study the difference in effective functional connectivity of the brain prefrontal cortex between the two modes of pain and rest based on the dynamic causal modeling (DCM) method. Effective functional connectivity changes in the prefrontal cortex between pain and rest states were calculated using DCM approach to investigate (1) areas known for pain sensation and (2) to analyze inter-network functional connectivity strength (FCS) by selecting several brain functional networks based on the analysis findings. All analyses were performed using toolboxes SPM-fNIRS and SPM8, Matlab software. Results: Regional hemodynamics changes caused deoxyhemoglobin concentration to decrease in the prefrontal cortex of both hemispheres, particularly on the right side. We found a simultaneous increase in the concentration of oxyhemoglobin in the prefrontal cortex of the left hemisphere in comparison to the right hemisphere, that there was a trend toward reduction in oxyhemoglobin concentration. The results indicate that during the cold pain stimulation, the connectivities between prefrontal cortex regions were significantly changed. Specifically, a significantly consistent increase in the RPFC to MPFC connectivity was found while a significant consistent decrease was observed in the both MPFC to LPFC and LPFC to MPFC connectivities. Conclusion: This study contributes to the pain research field to identify the directionality and causality of neuronal connections in the prefrontal cortex by applying DCM to fNIRS data. The results suggest that the proposed method infers directional interactions between hidden neuronal states in the brain under neuronal dynamic conditions based on optical density changes measurement.