A child has been rushed to hospital in a critical condition after suffering a shark attack at a popular beach.