The spine contains mechanisms that raise and lower its level of excitation even if it is separated from the brain. When nociceptive spinal circuits are more excited, they can transmit more nociceptive signals to the brain.
Spinal neurons can be excited by receiving rapid signals from the sensory neurons.
The spine contains inhibitory interneurons that control the types of sensory neurons from which the spine receives signals and the size of their receptive fields.
Signals from low-threshold A-beta fibers exert a calming influence at the spinal level. Gently brushing or rubbing the skin stimulates signals from the A-beta fibers. Those signals shrink the receptive fields and reduce the firing rate of the spinal neurons that respond to strong stimuli. The result is a reduction in the level of pain perceived. Reducing receptive field sizes generally reduces the number of action potentials generated by a given stimulus, as explained in the section, Anatomy and Distribution of Sensory Nerves.
Reducing the firing rate of spinal neurons reduces pain because the nervous system "decides" what is painful not only by which receptors are activated, but also by the frequency of signals in these spinal neurons.