I am reading The Last of the Tin Can Soldiers by James D. Hornfischer and what strikes me as miraculous is that despite constant sorties by American airmen (often while unarmed) they were hit very infrequently. I realize 23 were destroyed, but that is out of 3 taskforces after constant flight through flak. Were the Japanese crews that poorly trained and equipped or were the Americans just that lucky?
It is extremely difficult for non-radar guided guns to shoot planes. This is due to the fact that the plane can rapidly change direction and speed, as well as due to the fact that AAA fire travels in an arc.
In addition, the Japanese ships were performing extremely intense evasive maneuvers. This juking back and forth makes it even more difficult for ships to hit aircraft with anything more than blind luck.
The last thing to consider is that the Japanese were also unable to use their Type-3 "Sanshikidan" inflammatory air burst rounds. These rounds, nicknamed "beehives" were essentially large shells that when fired would explode in the air, scattering inflammatory fragments over a large area. Although its usefulness was in question, it could still have potentially been deployed at Samar, aside from the fact that the main guns were loaded with type-91 armor piercing rounds instead, as they were intending to encounter a landing force and their support units rather than a swarm of aircraft.
The larger Japanese AA guns were not radar directed nor did they have proximity fuses so it was mostly a matter of luck if they hit anything. The standard light AAA gun was the 25mm, sometimes in a triple mount. By 1944 this gun was not really useful. It had a slow elevation, the sights could not keep up with the faster aircraft of 1944 and they had a box magazine that required frequent changes (U.S. 40mm could be continuously top fed). U.S. AAA consisted of proximity fused, radar assisted 5" guns that were effective at great range, after that the US used a 40mm gun in either a triple or quad mount, further in there were 20mm guns in great numbers (There is an old story of an Admiral walking around a ship and demanded that a AAA gun be put in every place there was room for a card game). The 20mm were less effective late in the war, similar to the Japanese 25mm. The Japanese knew the 25mm was rubbish so late in the war they experimented with replacing them with 4.7" rocket launchers. http://www.navweaps.com/Weapons/WNJAP_12cm_AA_Rocket.htm. I believe some of the Carriers mounted them but I don't know if they were ever used in combat. Top all of this off with the fact that the Japanese had no air cover which allowed the Americans to attack unmolested by fighters so they had plenty of time to coordinate and follow through on their runs
Some more comments about the Japanese weapons are in order:
The 5" guns carried by the destroyers was not well regarded as an AAA weapon. Quoting Navweaps: "However, the very slow training speeds and lack of power ramming made these mountings almost useless against the fast-moving aircraft of World War II."
http://navweaps.com/Weapons/WNJAP_5-50_3ns.htm
The 5" gun that was the secondary armament on many of the ships was better, but the comment by /u/ParkSungJun applies there.