"Richard Cory," a ballad by Edwin Arlington Robinson, tells the story of a rich man who committed suicide. It uses some literary devices that are common in short or long fiction, including first person point of view, foils, figurative language, and irony.
The narration of the story comes from "we," an unnamed individual who groups himself in with the poor people of the town where Richard Cory lives. The effect of first person narration is to give the reader a limited perspective. We can only see and know what the narrator sees and knows; we cannot get inside the head of Richard Cory. Thus the ending comes as a complete surprise.
A foil is a literary device that uses characters that contrast sharply with each other. The contrast makes the qualities of each character more prominent. In this case, the townspeople are foils for Richard Cory, and vice versa. The opulent wealth of Richard Cory, his clothing, his manners, and his looks--all these stand in contrast to the "regular" people in the town who live in poverty, do not dress well, don't have the best manners, and are not so handsome. Richard Cory seems to have not a care in the world, while the other townspeople toil endlessly and can only hope for "light" in the future. Richard Cory's wealth highlights the poverty of the other people, and the poverty of the others makes his wealth all the more obvious.
The author uses figurative language when he compares Richard Cory to a king, and he uses the word "light" to represent hope or better fortune in the future.
Irony means that situations turn out the opposite of what one might expect. A twist or surprise ending is ironic. In this poem, when Richard Cory kills himself with no apparent warning, it is ironic because he seemed to have everything a man could want. If anyone would have been expected to commit suicide, it would have been one of the poor residents of the town who "worked and waited for the light." The unexpected ending is what makes this poem so powerful and memorable.