Public Relations vs Marketing & Advertising

How is the role of public relations in an organization different from marketing and advertising? What is the relationship among these three organizational components in a successful company?