One method is for the company to attach itself to a person or entity which displays the company in a favorable light to its intended audience. Establishing a marketing relationship generally means that the company trades for some return. The idea is to use the promotion to get the consumer into the store to buy the product. If Jim's Texaco advertises on Billy Bob fencer, the idea is to convince the consumer to buy gas at Jim's Texaco station. If United Airlines spends marketing dollars on a corporation, as they have with United States Fencing, the idea is to promote the airline and convince you that they are good partners and you should therefore fly United whenever possible.
Advertising is a bit different.
There is a fine line between marketing and advertising with advertising often a major component of marketing. In this case the company wants you to remember their product or service the next time you are in the market. You go to the store and stand in the soft drink aisle. Ad space on the uniform is appropriate, but this then probably becomes a business expense, not a tax deduction, for the company. Again, these have different tax implications than a simple donation, and are sometimes restricted by the Publicity Code.