This video that was made for incoming bomber crews during WWII may be of a great deal of help for you. It details how each different type of flak (other terms are anti-aircraft artillery, Triple-A, AAA, arty, or in WWI hate or 'ackack) was used, and how they could be defeated or at least minimized. Down on the deck (like the Dambusters) you could use the terrain to give you cover or concealment, and then all you had to do was defeat the human gunner. Unpredictable movements combined with low altitude and as much speed as you could muster were effective countermeasures.
Medium altitude was nasty. The low level automatic weapons were still effective, and you'd now entered the lower range of the bigger guns--lessening the flight time of their shells. High altitude flights could use the time it took for the shell to reach altitude combined with the time it took to acquire the target as well as the time it took to communicate this information to the gunners to let you avoid the worst of the flak. When an area was targeted instead--most often on your bomb run--speed was your best friend. Getting out of the targeted area as quickly as possible--not slowing your progress by trying to dodge--was the best method.
Also, something not covered in the video is that the Axis lacked a proximity fuse for most of the war. So, they couldn't fire their shells into an area and let the shell itself decide (via radio proximity) when to explode. Instead, that decision had to be made before the shell even left the gun. And since the sky is relatively huge and the targeted planes are relatively small, such a lack was critical to the bombers' survival.
Still, flak was quite nasty all by itself. This newsreel shows a B-24 being hit by Japanese flak about 50 seconds in. The results are catastrophic. Despite the best efforts of Allied intelligence to come up with effective countermeasures for Axis flak, the enemy could still extract a heavy price for straying within range of their guns.
As always, followup questions by OP and others are encouraged.