Understanding the modulations of the medial prefrontal cortex (mPFC) in the valence of the stimulus from rewarding and aversive status to neutral status is crucial for the development of novel treatments for drug addiction. This study addressed this issue and examined whether optogenetic ChR2 photostimulation in the cingulate, prelimbic, and infralimbic cortices of the mPFC regulated the valence of saccharin solution consumption from the rewarding property, the aversive property induced by morphine's conditioning, and the neutral states via saccharin extinction processes after morphine's conditioning. All rats received virus infection, buried optical fiber, optical stimulation, water deprivation, and saccharin solution consumption phases. In Experiment 1, rats were given ChR2 virus infection into the cingulate cortex (Cg1), prelimbic cortex (PrL), and infralimbic cortex (IL) to influence the rewarding saccharin solution consumption under photostimulation. In Experiment 2, rats were given ChR2 or EYFP virus infection into the Cg1, PrL, and IL to alter the saccharin solution consumption in the morphine-induced aversively conditioned taste aversion (CTA) and the saccharin solution consumption in the neutral state following the extinction process under photostimulation. Later, the immunohistochemical staining with c-Fos protein was performed for the Cg1, IL, PrL, nucleus accumbens core, nucleus accumbens shell, central amygdala, basolateral amygdala, ventral tegmental area, and dentate gyrus. The results showed that optogenetic PrL stimulation decreased the rewarding valence of saccharin solution consumption and increased the morphine-induced, aversive valence of saccharin solution consumption. PrL stimulation decreased the neutral valence of saccharin solution consumption via the extinction process. Cg1 optogenetic stimulation increased the rewarding valence of saccharin solution consumption and the aversive valence of saccharin solution consumption induced by morphine in conditioning. Optogenetic IL stimulation increased the aversive valence of saccharin solution consumption induced by morphine via conditioning. Altogether, optogenetic stimulation in the subareas of the mPFC modulated the reward, aversion, and neutral valences of the stimulus and altered neuronal activity in the mPFC, amygdala, nucleus accumbens, and hippocampus. Notably, the change of valence was temporary alternation during light-on related to the light-off periods. However, the findings may provide insights in the development of novel treatments for addictive symptoms.