Soliloquy (noun) is an internal monologue of a character of a play. When a character is on stage he narrates his inner thoughts aloud for the audience to know what is going on inside his mind.
Example- Romeo and Juliet's Juliet' famous soliloquy, "Romeo, O Romeo wherefore art thou Romeo". She was addressing her internal agony by reciting it to the audience, hence the whole speech was a soliloquy.