It's a frequent occurrence known as counter-battery fire. It's one of the more basic artillery strategies there is, employed as far back as there's been artillery. I suggest picking up John Norris' Artillery: A History. It's a good introductory primer to the history of big guns.
As /u/The_Alaskan pointed out, this is a very standard tactic, and a list of battles where both sides had artillery and never engaged in counter battery fire would probably be shorter than the list where it happened. As such, I have to remove this thread as it is liable to just be a very, very long list of examples. If you want to ask specifically about how counter-battery fire worked in, say, WWI or WWII, please feel free to resubmit. I know a few people on here, such as /u/vonadler , should be able to provide some good info for you.