Several brain regions, including the primary and secondary somatosensory cortices (SI and SII, respectively), are functionally active during the pain experience. Both of these regions are thought to be involved in the sensory–discriminative processing of pain and recent evidence suggests that SI in particular may also be involved in more affective processing. In this study we used MEG to investigate the hypothesis that frequency-specific oscillatory activity may be differentially associated with the sensory and affective components of pain. In eight healthy participants (four male), MEG was recorded during a visceral pain experiment comprising baseline, anticipation, pain and post-pain phases. Pain was delivered via intraluminal oesophageal balloon distension (four stimuli at 1 Hz). Significant bilateral but asymmetrical changes in neural activity occurred in the β-band within SI and SII. In SI, a continuous increase in neural activity occurred during the anticipation phase (20–30 Hz), which continued during the pain phase but at a lower frequency (10–15 Hz). In SII, oscillatory changes only occurred during the pain phase, predominantly in the 20–30 Hz β band, and were coincident with the stimulus. These data provide novel evidence of functional diversity within SI, indicating a role in attentional and sensory aspects of pain processing. In SII, oscillatory changes were predominantly stimulus-related, indicating a role in encoding the characteristics of the stimulus. We therefore provide objective evidence of functional heterogeneity within SI and functional segregation between SI and SII, and suggest that the temporal and frequency dynamics within cortical regions may offer valuable insights into pain processing.