The literary device in which a character is alone on stage revealing his innermost thoughts and preoccupations is called

soliloquy.