There’s not much in the air for an aircraft to hit, besides other aircraft. Lights on an aircraft in flight are to help the airplane be seen, not to help the airplane see.
On landing, forward-pointed lights are nice to have, but since runways are illuminated, it’s possible to land safely without them. Airliners in particular will probably never be landing on a darkened runway and need to worry about hitting invisible terrain or obstacles ahead, because they’re always either above the obstacles or they’re on a known safe descent path.
Pretty much anything you want to avoid in the air is (or should be) lit. Other airplanes, radio towers, that sort of thing. If it’s not lit, then either you couldn’t have done much to avoid it anyway (bird), or you should be able to anticipate it (terrain).
Airplanes do have landing lights, which are quite bright and point forward. In the US, commercial flights are required to have them on under 10,000 feet. They are used to illuminate the runway for takeoff and landing. Planes should not be close enough to illuminate anything with their landing lights until landing though, and they are required to be on to allow aircraft to see each other more easily.
Taxi lights are similar but generally less bright, and help the pilots see where they are going when taxiing on the ground without airport lighting.
This diagram of lights on the MD-11 shows the main areas illuminated by the taxi and landing lights. The other lights help to make the aircraft more visible as well. Runway turnoff lights on airliners also help to light up areas to the side of the aircraft after landing to more easily see upcoming runway turnoffs.
Now I’m going to cover the other ways that an aircraft can “see” what’s around it. IFR navigation and avoiding controlled flight into terrain are related topics.
The answer depends somewhat on whether we’re talking about visual flight rules or instrument flight rules. Visually spotting lit obstacles is far more important if you’re not instrument-rated. Of course, planes don’t have to visually see obstacles to avoid them. Properly trained pilots can fly IFR in zero visibility, so they have plenty of tools to identify threats ahead that they can’t see.
Aircraft can fly in low visibility situations where even lights won’t do you much good. This is done in large part using careful navigation and reference to charts. Sectional charts are required to show peaks, towers, and other obstructions as shown in the legend below. Approach plates and procedures may also list smaller obstacles particularly close to the runway.
You’ll notice that the sectional below has the obstructions marked, as well as a big 07 in the right hand bottom. That 07 means that the highest terrain or obstruction in the right hand box on the image below (basically everything east of Logan Intl Airport, outlined by straight lines with tick marks) is 700 feet, including a small margin and rounding, so if you’re flying safely above that altitude you can avoid obstacles.
A new emerging technology is synthetic vision, as mentioned in SierraSkyport’s answer. This system combines precision location information with very detailed terrain and obstacles databases to provide a view of the surrounding area.
This is sometimes combined an enhanced vision system with an near-IR camera to see in darkness and through fog and clouds, and this clear camera-based view of the surrounding area is often overlaid on the center of the synthetic vision display. I’ve seen a near-IR camera in action and you can actually make out features like the edge of the runway and buildings, even in very low visibility. (Image by Honeywell, provided with Permission)
TCAS and ADS-B
Your major obstacles when above the ground are other aircraft (I don’t know what else you’d hit in the air, meteorites?) Any aircraft equipped with a mode-C or mode-S transponder is “visible” to a plane with TCAS, and the TCAS system will provide traffic alerts for nearby aircraft (and guidance for how to resolve the conflict if the intruder gets close enough and it’s a TCAS II system).
ADS-B in also provides a traffic information for any nearby aircraft equipped with ADS-B out (which thanks to mandates is becoming very common). If you have ADS-B out as well as ADS-B in, you’ll additionally receive radar information for all aircraft from ATC over a service called TIS-B. ADS-B is often supplied integrated into a mode-s transponder, but this is not always the case, so you could have ADS-B out and ADS-B in but not a TCAS-compatible transponder.
TAWS, GPWS, and Radar altimeter
For avoiding the ground these systems provide some information to avoid a controlled flight into terrain. Terrain awareness warning systems (TAWS) and ground proximity warning systems (GPWS) (the two are sometimes synonymous) are now required by the FAA on all large turbine and turbojets. These systems warn if you’re descending too fast, below the glideslope, or flying too close to terrain, based on a radar altimeter. Even without this system, you may have a radar altimeter to monitor your height above terrain.
Weather Radar (or Stormscopes), XM radio, and ADS-B all provide excellent information about weather ahead that you can’t see. Most non-military aircraft do not have primary radar for seeing things other than weather. Since ATC provides their own primary radar information over TIS (ADS-B traffic information), there is not much need to have a primary radar on the aircraft.
In a worst case scenario ATC has tools like minimum safe altitude warning systems and short-term conflict alerts and may alert you if you’re about to run into terrain or another aircraft. As far as I understand, this isn’t supposed to be your primary method of avoiding obstacles though, even in IFR conditions.
Night Vision Goggles
Of course, if you really need to see far ahead of you in dangerous terrain, you can use night vision goggles. Your aircraft needs to meet certain requirements and you need training, however.