Ubik is, even by Philip K. Dick's standards, a very strange book. The distinction between real and unreal, obscured by the perception of the main character(s), is actually very common in his work. What sets this work apart, is that this distinction is blurred in more than one way.
The main theme of the book is, it must be figured out who is alive and who is dead - which is very difficult given the premise, that a dead person's consciousness can live on.
This setup is distorted by the presence of a group of people with a wide variety of psychic powers, among whom a woman with the ability to change the past, and thereby, the present. As a result of that, the story itself has a tendency to jump from one timeline, or reality, to another one from one line to the next. This guarantees a very unsettling read, but also a very satisfying one.