Fix the Source of the Problem
Lift the carpet up from the tack strip in the area that you suspect has been affected by moisture and is now harboring mold. Start at the corner of the carpeting that is closest to the mold and fold the carpet onto itself if necessary. You need to lift enough of the carpet so that you can get a good look at the floor underneath and the adjoining walls.
Identify the cause of the mold problem. In most cases, water is the problem; so you will need to locate the point of entry and correct it. If rain water is coming in through the foundation, saturating your carpet and causing mold to grow, you must seal the area with a compound that will hold back the leak. If dampness or humidity is causing the mold problem, proper ventilation will need to be installed. An exhaust fan, humidifier or dehumidifier may sometimes solve the problem.
Remove the Mold From the Carpet
Remove the original padding from underneath the carpet, and examine the floor beneath. If it is wet, allow it to dry out before laying more padding over it. If there is a cement floor under the padding, wash it down with a solution of one part bleach and one part water. Allow the floor to dry thoroughly. Mix a natural mold and mildew cleaner according to the manufacturers' instructions. Apply the natural product with a scrub brush, and scrub the underside of the carpet as well as the carpet fibers on the front. Continue scrubbing until the mold stains are no longer visible.
Dry It Out and Put It Back
Close off the room that contains the moldy carpeting, and use a floor fan to dry the carpeting completely. The drying process can take overnight, or it can take a few days, depending on the amount of saturation. Try not to rush the drying process. If you do, the problem may reoccur. Apply a new layer of padding, and new tack strip if the original tack strip is showing signs of mold. Lay the carpet back down in place, and vacuum well to remove any loose debris. Keep an eye on the area of carpeting that was affected by the mold to be sure that the problem does not return.
Keep in mind that black mold can be a serious health hazard. If your carpeting has been struck by flooding that has left it completely under water for a few days and the carpet has a strong smell of mold, cut your losses. This is especially true if the carpet is showing signs of black mold spore growth. It is better to spend the money to replace carpeting than risk serious respiratory illness or rashes.