Teenagers are by definition solipsistic. I was vile as a teenager and I didn't have a horrible homelife to excuse it.
Speaking as a teacher, in my experience they mostly undergo some kind of horrible transformation over the summer holidays between Years 8 and 9 and the lovely, funny, sweet, eager little kids return to school as absolute buggers.
Then, in about the middle of Year 11 they suddenly become gorgeous again.
So...It's normal. Clearly exacerbated by her less-than-ideal family set-up.
Practically, the worst thing you can do is tell her off. Teenage girls all labour under the belief that they are uniquely tortured and misunderstood, and calling her on her behaviour will only confirm that you are a terrible cunt just like everyone else.
It may stick in your craw, but you'll get far more joy out of a gentle, "Lucy, is everything ok? You seem to be so angry and upset at the moment...I love you, is there anything I can do to help?"
There will be floods of tears and some confessions of how and only Sylvia Plath and Brandon Lee could understand how COMPLETELY UNHAPPY she is (it may emerge that Marnie told Aiden that she is a slag, or some such nonsense).
It won't really change her behaviour but she'll be a bit nicer (if only around you) because when you're feeling isolated and put-upon (however utterly unjustified) having an ally is pretty much the one thing that improves your outlook.
Good luck. Grin and bear it - you've just gotta ride it out. She'll be grand again in a couple of years.