A geometric theory of waves and its applications to plasma physics