Let's look at this for the most simple case of a wave propagating along the x direction. The wave is described in terms of a Fourier transform
f(t,x)=\int_{-\infty}^{\infty} \frac{\mathrm{d} k}{2 \pi} \tilde{f}(k) \exp[-\mathrm{i} \omega(k) t+\mathrm{i} k x].
The dispersion relation
\omega=\omega(k)
depends on the specific physical situation. In optics for the most simple case of an unmagnetic homogeneous and isotropic material it's related to the dielectricity function \epsilon or the index of refraction n(\omega).
Now suppose we have a wave packet which is nearly monochromatic, i.e., \tilde{f}(k) is rather sharply peaked around a wave number k_0. Then we can approximate
\omega(k) \simeq \omega(k_0)+\omega'(k_0) (k-k_0).
Plugging this into the above Fourier integral we get
f(t,x)=\exp[-\mathrm{i} \omega(k_0) t+\mathrm{i} k_0 x] \int_{-\infty}^{\infty} \frac{\mathrm{d} k}{2 \pi} \tilde{f}(k) \exp[-\mathrm{i} k (\omega'(k_0) t - \mathrm{i} x)].
This means that the envelope of the wave packet approximately travels with the speed
v_{\text{g}}=\omega'(k_0),
because in this approximation the shape of the envelope is unchanged, because
|f(t,x)| =F[\omega'(k_0) t-x].
This approximation, of course holds only true if \omega(k) doesn't change too rapidly around k_0.
For optics the dispersion relation reads
\omega(k)=\frac{c k}{n(k)}.
Then the group velocity for quasi-monochromatic signals with wave numbers around k_0 becomes
v_g=\omega'(k_0)=\frac{c}{n(k_0)} \left [1-k_0 \frac{n'(k_0)}{n(k_0)} \right].
For visible light, for most materials usually the index of refrection is increasing with increasing wave number (i.e., decreasing wave length since k=2 \pi/\lambda). This is called normal dispersion. However, it can also happen that, for some frequencies, the index of refraction becomes decreasing with increasing wave number. Then it's called a region of anomalous dispersion.
Particularly in regions of k, where there are resonances, the approximation breaks down, and the group velocity looses the physical interpretation just given. In optics around a resonance frequency of the atoms, molecules, the crystal lattice, etc. \omega'(k_0) can even become negative or larger than the speed of light in vacuum (anomalous dispersion), but this in reality doesn't mean any violation of Einstein causality in electrodynamics, because in such cases the signal becomes significantly deformed and the approximation made above to introduce the group velocity invalid. One can analytically show that the wave front only propates maximally with the speed of light in vacuum. This has been demonstrated already around 1910 by Sommerfeld and Brillouin. For a good explanation about these phenomena see A. Sommerfeld, Lectures on Theoretical Physics, Vol. 4 (Optics) or J. D. Jackson, Classical electrodynamics.