scooby,
The capacitor has an impedance - reactance actually - to AC which is 1/(2Pi.freq.C) where C is the capacitance in Farads. The reactance limits the current in much the same way as a resistor, except that the voltage and current have a 90 degree relative phase angle. With a 90 phase there is no power dissipated in the capacitor, but current is still limited.
When you first apply voltage to a discharged capacitor, a very high current flows for a very brief period. use of the resistor in series with the cap as described above keeps the inrush current within reasonable limits to avoid damaging the circuit supplied through the cap.
If you are choosing a capacitor for direct connection to the AC line, you must use a Class X2 or Class Y capacitor. The Class Y type is usually reserved for live (or neutral) to earth applications, so in this case the X2 type is better suited.
----------------------------------
If we learn from our mistakes,
I'm getting a great education!