This is a great question, but before we get to the meat of your query, I want to clear up two misconceptions that are present in the question itself.
The first is that the Moon has something to do with the day/night cycle. Days and nights occur because the Earth is spinning rapidly on its own axis. The Sun, which is relatively stationary with respect to the Earth on the timeframes of a few days, continues to shine from the same point. As the part of the Earth that you or I live on rotates to face towards or away from the Sun, we get day and night respectively. The Moon orbits much, much slower around the Earth - approximately once every month. The Moon can occasionally cast a shadow onto the Earth, but that’s a rare event we know as a solar eclipse.
The second is why you sunburn at altitude. You absolutely are more prone to sunburns at higher altitudes, but it’s not because you’re significantly closer to the Sun. The Sun is 93 million miles away - getting a single mile or two closer isn’t going to make a significant change to the amount of sunlight that your skin’s getting. What happens instead is that you’re rising above some of the protective layer of our atmosphere, which allows more ultraviolet radiation to reach you. This UV radiation is what triggers a sunburn, and the more atmosphere above you, the more protected you are. If you’re on a snowy mountain, you have the additional complication of being able to get sunburned in really strange places, like the underside of your earlobes and the bottom of your chin, because of the reflected light off of the snow.
With those two points addressed, your question about lighting in space is an excellent one. There’s a couple things to think about with lighting, so let’s begin with a spacecraft which is near the Earth. If you are in a position where nothing is blocking the sunlight coming your way, you would be constantly bombarded by the Sun’s rays, exactly as you suspect. However, this is an extremely harsh lighting system - with no atmosphere in space to diffuse the light a little, spacecraft are in pure sunlight or deepest shade. If a spacecraft is moving around the Sun, that means that the sunward facing side of the spacecraft would be illuminated, and the other half of your spacecraft would be in shadow - triggering a pretty intensive temperature gradient between the two sides. As a point of reference, the temperature on the surface of the Moon swings between 224F (106C) and negative 298F (-183C) when the surface is illuminated versus when it is in shadow.
This temperature cycling causes stress on most materials you could build a spacecraft out of, and is a challenge we face already as a moderately spacefaring species. The International Space Station, which orbits around the Earth, alternates between spending 45 minutes in the shadow of the Earth and 45 minutes in direct sunlight. Without intensive, intensive insulation, our astronauts would alternate between freezing to death and boiling to death. We have to manage this same situation on a smaller scale for space suits; in the sunlight, your suit has to keep you cool and protect your eyes from glare. In the shadows, it must keep you warm.
These considerations will only get worse as you get closer to the Sun, or really around any star. As we proceed inwards, closer to the sun, the sunlight gets more intense, and the amount of work you’d need to do to stay cool would increase. The cool side of your craft wouldn’t get any colder, but the temperature stress would get more severe between the sun and shaded sides of your craft, so your insulation would have to get much better. This intensity doesn’t change linearly though - if you got twice as close to the star, the sunlight won’t be twice as intense. It will be four times as intense.
This works just as well in the other direction - go twice as far out in the solar system, and your sunlight will drop off by a factor of four. Go four times as far, and you’re dealing with light intensity 16 times fainter than you have at the distance of the Earth. However, the Sun is very bright. Jupiter is 5.2 au - and Neptune at 30 au. At 5.2 au, you’re dealing with sunlight 27 times fainter than what we receive on Earth. It’s still going to be the brightest thing in the sky. Neptune is much further, but even at 900 times fainter than the Sun appears from an Earth distance away, it still hasn’t faded to anywhere near the relative faintness of the full moon in the sky, and you can do a lot in the light of a full moon, visibility wise.
The way that astronomers measure brightness is with a counterintuitive system called a magnitude, where 1 magnitude is about a factor of 2.5 in brightness. Every magnitude is multiplicative, so five magnitudes is a difference in brightness of a factor of 100. A difference of ten magnitudes is a factor of 10,000 in brightness. At Jupiter’s distance, then, the Sun will appear about 3.6 magnitudes fainter than it does from the Earth. At Neptune’s distance, it’s something like 7.5 magnitudes fainter. The brightest star in the night sky, Sirius, is 25 magnitudes fainter than the Sun, so even at the distance of Neptune, the Sun will appear more than 10 million times brighter than Sirius appears on Earth. The full Moon, which I mentioned earlier, is fourteen magnitudes fainter than the Sun, so the Sun would be shining on Neptune about 390 times more intensely than the full moon.
If your fictional craft is within the bounds of a solar system then, I’d say having the craft be brightly illuminated on one side is pretty reasonable. If you’re going beyond that, though, you’d start to descend into full darkness. You’d have to be very far away from our star before the Sun sank to the brightness of Sirius. In fact, you’d need to be almost 1.5 light years away from our star. The spaces within the stars, which is the majority of the Milky Way Galaxy, are going to be very dark. In those places, the only bright lights will be the ones you bring with you. You probably would want to have a few spotlights around, if any of the crew ever has to go outside for any kind of repair operations, but it wouldn’t have the same aesthetics as the harshly lit side of a spacecraft that many shows like to go for.
This site is reader supported! To support it, you can become a patron on Patreon, which gives you early access to this article. You can also make a one-time donation via Ko-Fi! Or, consider buying the book!