A monologue is a long speech by one actor in a play or movie, or as part of a theatrical or broadcast program. A soliloquy is an act of speaking one's thoughts aloud when by oneself or regardless of any hearers, especially by a character in a play.
In a soliloquy, the speaker isn't addressing anyone. A monologue may be addressed to other characters or the audience. It also is that a soliloquy is more or less something that is thought.