This is Dunguaire Castle in county Galway, at about the easternmost reaches of Galway Bay. Its about 400 yards north of the busy little town of Kinvara, right on the coast (you can't miss it) It was built in the early 16th century and has associations with Yeats, Synge and Shaw. I was travelling from Loughrea, heading for Doolin and decided to make a short detour to see this and Black Head lighthouse.
Why Dunguaire Castle? Well, I found one photo of it on the net saying that they used to shine a light from the top of the castle to guide boats into Kinvara harbour. In which case it would be a lighthouse. Sadly, I have been able to find no corroborative evidence anywhere of this!