The main reason medicines are so much dearer in Ireland compared to other European countries is our smaller population (and therefore smaller market for the products). In order to place a medicine on the market, it must be licensed by the Irish Medicines Board. (Similarly, meds sold in UK must be licensed in UK, meds in France licensed in France etc.)
This licence fee in each country is a huge cost to the manufacturer. They recoup it by factoring it into the price charged for the med in the country. In Ireland, because our population - and hence market for the med - is so small, the cost is spread over relatively few people, and so the price is far higher. These higher cost prices are agreed between the manufacturers and the Irish government. This is even before wholesalers and retailers apply a markup.
Cost price charged by manufacturer to wholesaler -> wholesaler adds markup to yield wholesale price charged by wholesaler to retailer (e.g. pharmacy) -> retailer adds markup (zero markup in the case of medical card prescriptions!) to yield retail price charged to consumer.
In fact, the retail price of some meds in countries like Spain is lower than the cost price in Ireland due to economies of scale!
Many meds simply aren't licensed in Ireland at all because it wouldn't be cost effective. The range of meds available in the UK is far greater. Unlicensed medicines are posing an increasing problem in medical practice in Ireland.