There are many different ghosts in the Harry Potter books. I just want to focus on the ghosts that haunt Hogwarts.
First of all, there is Nearly Headless Nick (or as he prefers to be called Sir Nicholas de Mimsy-Porpington). He is the ghost of Gryffindor tower. While reading about him in the books you learn that he is nearly headless because his execution was so poorly done. The blade wasn’t sharp and he ended up having to be cut something like 43 times. So his head isn’t totally cut off from his body. This causes him a lot of embarrassment because it means that he can’t join The Headless Haunt every Halloween. He was actually killed on Halloween and has death day parties. In The Chamber of Secrets, he is celebrating his 500th death day with a party that he invites Harry Potter to.
The Grey Lady is the ghost of the Ravenclaw house. She is Helena Ravenclaw, the daughter of Rowena. She stole her mother’s diadem and now haunts the tower. After finishing her schooling at Hogwarts, she runs away to Albania. She is shy and stays away from people, except for Luna. She is friends with Luna and eventually helps Harry Potter find her mother’s diadem after he is introduced to her by Luna. The only other student that we know she befriends is Tom Riddle. He wants to find the diadem and uses Helena to find it. He then uses dark magic to turn it into one of his Horcruxes, causing Helena to become even angrier and more recluse.
The Bloody Barren is the ghost for Slytherin. He is described as an intimidating presence and the only one who can really control Peeves. He was in love with Helena, but she didn’t love him back. Rowena sent the Barren to find Helena in Albania and bring her back since Rowena was dying, but Helena wouldn’t come. The Barren stabbed and killed Helena, and realising what he did, he then killed himself.
The Fat Friar, the last of the house ghosts, is associated with the Hufflepuff house. He is described as being jolly and forgiving. He studied religion, and after his death haunted the Hufflepuff house.
Then, of course, we have to talk about Moaning Myrtle. She haunts the 3rd-floor girl’s bathroom. She is angry and complains all the time. She loves to see others in distress. She ended up haunting her toilet because of Tom Riddle. She was constantly teased while she attended Hogwarts, and was in the bathroom crying one night. She heard a boy’s voice speaking a strange language and went out of her stall to tell him off. Unfortunately, she only came face to face with the Basilisk, and immediately died. As far as we know, she is the only Hogwarts student to actually die from the Basilisk.
I want to include Peeves in this post as well. Although technically a poltergeist, not a ghost, he still haunts the castle. He apparently “came with the school” when it was founded and has called it home the entire time. He once forced the school to be evacuated for three days because someone tried to capture him but instead gave him access to some pretty dangerous weapons. He is a nuisance to the students and the teachers, and the Bloody Barren seems to be the only one he has any respect for. In the Prisoner of Azkaban, Lupin actually shoots a piece of gum into this nose using a simple spell. In The Order of the Phoenix he helps the students torment Umbridge, and in The Deathly Hallows, during the battle of Hogwarts, he does his best to protect his school. It’s a shame that his presence is left out of the movies. He is such a character!