The transfer of resonance-line radiation in static astrophysical media