The lamp is proberly not connected direct to the mains supply, it is usually controlled by a small unit which adapts the mains first to run the light.
It may be electronic or possibly have a starter lamp with it that needs replacing.
Follow the leads from the lamp they will lead to the control unit, that runs the lamp, this unit may be worn out and needs replacement.
These small lamps do go black at ends but usually still run for a while .
But it does sound possibly like the unit is going allowing too much current through the ends causing premature failure and excessive blacking to the ends.
Also check the WATTAGE on the lamp matches what is on the unit.
It looks as if your unit is poted. That is after it is made it is filled with something to stop water and any maintainance. Never the less what Rocky says still is correct but looks as if only cure is complete new unit.
One thing Rockey did tell you was to check on tube size. For specialist tubes often the wattage is greater than tube the same physical size for standard use. And if for example designed for 11 watt and you fit an 8 watt then you will get the problem you describe. Often with fish tank units there is no fitting as such just two plugs and longer or shorter tubes can physical be plugged in but will not electrically be compatible. Also some are thicker than others. Do therefore check the details on unit match details on tube.
DIY how to tutorial projects and guides - Did you know we have a DIY Projects section? Well, if no, then we certainly do! Within this area of our site have literally hundreds of how-to guides and tutorials that cover a huge range of home improvement tasks. Each page also comes with pictures and a video to make completing those jobs even easier!