It's been my experience that people usually start into the 'Goth' phase (wearing all black, idealizing death or making light of it) to get needed attention. It sounds like this girl is trying to draw attention that she needs help, that something is not right. Maybe she doesn't know what kind of help she needs, or doesn't trust enough to get help, so she's just acting out her pain.
My advice to you would be to tell someone that you know she is in need of help. You could tell your guidance counselor at school that you are concerned and that you wish to remain anonymous when they speak to her; that you would like your name totally left out of the matter. If you don't trust that they will let you remain anonymous, and you do not want her to know it's you, write a letter of your concerns, leave it on the office desk or mail it to the school with no return address and leave it unsigned.
In addition to that, you could write an anonymous letter to her parents. Leave out specifics that only you know about if you don't want her to know that it was you, and stick to the general reasons you are concerned (wearing all black, losing interest in grades, speaking of death, loss of faith in God, etc...) Also tell them that you think she needs understanding, not more punishment or trouble.
You could have your parents talk to them or write the letter. If your parents want to say who they are, then you could ask that they not tell their daughter who wrote this letter because you are afraid she will be angry at you and may even hurt you.
This is a tricky situation because there is not a whole lot you can do, especially when you are just trying to be a friend the only way you are able now (since you don't want to really hang out with her and stuff, understandably) but you are also afraid she will hurt you. Just keep telling your parents everything that's happening, and I hope that someone can guide her to the help that she needs.
-Erin-