Those grey to black areas on carpet edges are a result of moisture and soap residue left from past cleanings. The residual moisture attracts and holds settling dust. In the past I have had some success with a carpet steamer, hot water and extraction but you will have some slight discoloration.
Hope this helps