A Mexican marine biologist was seriously injured after he was attacked by a shark while working off Costa Rica's Pacific coast and transferred to a hospital in the country's capital on Monday, authorities said.