Nociception is critically shaped by descending modulation of spinal circuits, yet its cellular and synaptic mechanisms remain poorly defined. Elucidating these mechanisms is technically challenging, as it requires simultaneous activation of primary afferents and descending fibers while monitoring the functioning of individual spinal neurons. Here, we present a method to investigate the influence of the rostral ventromedial medulla (RVM), a principal supraspinal structure mediating descending modulation, on the activity of spinal lamina I neurons. Our approach combines electrophysiological recordings in ex vivo intact spinal cord preparation with optogenetics, granting several advantages. First, ex vivo preparation spares rostrocaudal and mediolateral spinal architecture, preserving lamina I as well as primary afferent and descending inputs. Second, virally mediated channelrhodopsin-2 (ChR2) expression enables selective photostimulation of RVM-originating fibers. When coupled with patch-clamp recordings, this photostimulation allows identifying postsynaptic inputs from RVM to spinal neurons and revealing RVM-dependent presynaptic inhibition of primary afferent inputs. Overall, our approach is well-suited for investigating both pre- and postsynaptic mechanisms of descending modulation in physiological and pathological pain conditions.