There is still some debate among religious scholars about this very topic, but for those who are writing a novel or comic-book there are TWO WAYS to write about angels and demons-
1. Free Will- With this method, the spirits are self-aware beings that have a choice about what they can or can't do. I think this is a pretty cool way to portray spirits because it can lead to an interesting look on how angels do their jobs. A primary example is Lucifer; he decided to rebel against God and was subsequently kicked outta heaven.
2. Manifestion of Divine Will- With this method angels and demons are an extension of the being that controls them. Basically, they lack awareness and even consciousness as they can only do what they are told to do.