Well, before you go replacing carpeting and pad, you need to determine the source of the leak.
Does your car have a sunroof? Is the headliner also wet in any locations? If so, you may have a plugged drain for the sunroof channel or a disconnected drain hose.
If you don't have a sunroof, you might have a leak at the windshield or around one of the doors. Is there any evidence that the windshield has been replaced or the car has been in an accident? You might try washing the car, then inspecting the weatherstripping around the doors to see if you can find a place where the weatherstripping doesn't seem to be touching the door.
Were you running the defroster and driving in the rain? Maybe the evaporator core drain is plugged, but then you'd also notice moisture on the floor after a long time using the air conditioner as well.
-Rod