Example:
Some methods for 2D Field of Vision suggest scattering out a bunch of raycasts, shotgun style, to see when they’ll collide with walls like so:

Depending on the amount of resources you can afford to invest, you can make a very nice effect that way. I found that this wasn’t working for me in GameMaker. To keep a decent framerate, I was having to use a very low number of rays, and lowering the precision to unacceptable levels (12 rays only checking for collisions every 8 pixels is far from ideal).
After some research, I came to the conclusion that I could do something else to get the desired effect. Every Update I have the game perform the following algorithm. I start by having all the wall chunks that are on screen (or nearly on screen), check themselves into a global list (or remove themselves if they are not in range):

Since I have a start point and an end point, I can just do a line collision test from each corner of those wall chunks (I actually ended up doing two parallel line collisions, because there were some clipping errors now and then):

Here are my winning end points:

To cover the concealed parts of the map, I first fill a screen-sized Surface with black:

Then I cut away a Triangle Fan primitive, using the player as the origin (this is why the points needed to be sorted by ascending angle earlier):

Finally, I would stamp out a rectangle where the wall chunks actually were, so the player could see what was impeding their vision (hey, we already have a list of walls for that!).
This method works well because I don’t have a lot of large open spaces in my game, you could try adding points along the edges of the screen to your list of points to make it more effective in large open areas.
Well, I hope you found my awful drawings somewhat helpful in explaining this process. I ultimately decided to go with a Fog of War effect because as much as I wanted to surprise the player it felt kind of claustrophobic to use a Field of Vision effect to do so.