That's advertising. Some consider it a subset of marketing. Some consider it an entirely separate area. I agree. Ads on web pages are resource hogs. ;)
In its purest form, marketing is any communication from a company. Without marketing you would not know about any products from any company. So some forms of marketing are very valuable to everyone. As with any discipline there are bad points as well.