There is a difference between phone book listings in the directory and an ad. Most phone book companies will require a fee for listing in the phone book, but the cost of an ad is much higher.
I am not sure if you are referring to a listing or a simple ad. If the company name, address, and phone number appear to be the same as the surrounding residential listings, then it is not an ad but a directory listing. A company will usually have to pay a monthly fee for an ad. If the information is emphasized in any way, like bold face or outlining, that is an ad.
The cost of an ad depends on the size, where the ad is placed, what is in the ad (pictures, graphics and so on) and how much color there is in the ad. Even a small, relatively simple ad can cost hundreds of dollars.
With smartphones, many people look on their online yellow pages to find a business. Oftentimes, online directories are the same companies that sell the phone books.