I think that most of us have an image of pirates with ships that fire cannon balls, but what about before the cannon was invented? Did they have something to fire at other ships to damage them or even destroy them?
There are a few misconceptions in your question.
First, even during the golden age (early 18th century) or bloody age (19th century) of piracy, it would have been relatively rare for pirates to use artillery during an attack. Most pirates still relied on a type of naval warfare known as "galley tactics," or the use of the ship and its crew as the weapons to attack other ships. Many merchant vessels were unarmed or poorly armed, so simply getting alongside the ship and boarding it via ladder or grappling hook would be sufficient. Once aboard, pistols, swords, knives, and blunt weapons would have been sufficient to subdue most merchant crews. Canons would be reserved for fighting armed (typically military) vessels.
If a pirate was going to seize the commodities aboard a vessel, it's likely that they would seize the vessel as a means of transport and perhaps a commodity to be sold later (although this was quite difficult). To be sure, there are many instances in the historical record when captured ships are scuttled, but that is usually done at the end of the process rather than the beginning.
Second, pirates in antiquity did not typically attack ships. The Greek word "peirates" was usually used to refer to folks from Islands who would raid coastal villages from the sea rather than land. The same is true for the Roman period.
With that out of the way I can give you an answer. Naval combat in antiquity is distinct from early/modern naval combat principally due to two things: (a) oar power and (b) light ships. Oar power was used to achieve tactical mobility in close quarters combat, allowing ships to do things like turn on the spot, vary their momentum, and fight in windless conditions. Although sails were used for long-haul maneuvers, oar power placed constraints on ships. They would have relatively large crews and were relatively light. Thus the crew and the ship itself were the primary weapons. Ships were often outfitted with battering rams, and a head on collision into the hull of another vessel would often be enough to break the ship apart (or at least breach the hull). Boarding a ship and fighting hand-to-hand was also common.
I've not read any accounts of projectiles being used in antiquity (e.g., deck-mounted catapults). However, it was common to try to set opposing vessels on fire by various means. Otherwise sailors might drop rocks or other weights onto a ship in an attempt to puncture the hull.