These lines are spoken by Macbeth. First, he is generally meaning that life lacks substance, comparing life to an actor who, as said in the following line, doesn't have enough time on stage but is performing the best he can, nevertheless—until the play is abruptly over. In the last two lines, Macbeth is comparing life to a story told by someone who lacks intelligence; therefore, the story is nothing more than meaningless rambling.