Just as a precaution you might want to cut off some healthy branch tips and see if you can get them to root. Rosemary will I think grow from cuttings, but this is probably not the best time of year to try it. If you have a very sunny window (I forget what part of the country you are in) they might be OK indoors until it warms up outside. If your cuttings take hold you will have fresh new plants that are green all the way down. For a really low-tech option, bend one or more of the branches down to the ground (or if you suspect the soil, a flower pot full of a better growing medium) and put a large rock or brick on top of it. If it roots, fine—if not, then "no harm, no foul".
I am not sure what is making your plant turn black. I have seen rosemary growing just fine here in Seattle, which is nothing if not wet. And when I was a kid, we had a big bush of it in our backyard (in San Jose CA) growing in sticky adobe clay soil. Is it in full sun? That's what it likes.