We analyze the connectivity structure of weighted brain networks extracted from spontaneous magnetoencephalographic signals of healthy subjects and epileptic patients (suffering from absence seizures) recorded at rest. We find that, for the activities in the 5-14 Hz range, healthy brains exhibit a sparse connectivity, whereas the brain networks of patients display a rich connectivity with a clear modular structure. Our results suggest that modularity plays a key role in the functional organization of brain areas during normal and pathological neural activities at rest.